#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    2
    Rep Power
    0

    Post Tablelayout xml problem


    i just want to run this into the emulator but it has an error can someone help me thnx in advance

    xml

    <?xml version="1.0" encoding="utf-8"?>
    <TableLayout
    android:id="@+id/tableLayout1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >

    <TableRow
    android:id="@+id/tableRow1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_horizontal" >

    <TextView
    android:id="@+id/textView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_span="6"
    android:gravity="center"
    android:text="@string/Calories"
    android:textSize="18sp"
    android:textStyle="bold" >
    </TextView>



    </TableRow>

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#FF0000">
    </View>

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#FF0000">
    </View>

    <TableRow
    android:id="@+id/tableRow2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >



    <TextView
    android:id="@+id/TextView2"
    android:gravity="center"
    android:text="@string/zero"
    android:textStyle="bold"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:typeface="serif" >
    </TextView>

    <view
    android:id="@+id/view1"
    android:layout_width="1dp"
    android:layout_height="32dp"
    android:background="#000000" />

    <TextView
    android:id="@+id/TextView4"
    android:gravity="center"
    android:text="@string/zero"
    android:textStyle="bold"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:typeface="serif" >
    </TextView>

    <view
    android:id="@+id/view40"
    android:layout_width="1dp"
    android:layout_height="32dp"
    android:background="#000000" />

    <TextView
    android:id="@+id/textView6"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:text="@string/zero"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:textStyle="bold"
    android:typeface="serif" >

    </TextView>
    </TableRow>

    <TableRow
    android:id="@+id/tableRow3"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >



    <TextView
    android:id="@+id/textView7"
    android:gravity="center_horizontal"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:ems="4"
    android:text="@string/Overall" >
    </TextView>


    <view
    android:id="@+id/view41"
    android:layout_width="1dp"
    android:layout_height="35dp"
    android:background="#000000" />

    <TextView
    android:id="@+id/textView9"
    android:gravity="center_horizontal"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="@string/Thisweek" >
    </TextView>



    <view
    android:id="@+id/view42"
    android:layout_width="1dp"
    android:layout_height="35dp"
    android:background="#000000" />



    <TextView
    android:id="@+id/textView11"
    android:layout_width="wrap_content"
    android:gravity="center_horizontal"
    android:text="@string/Today"
    android:textAppearance="?android:attr/textAppearanceLarge" >

    </TextView>


    </TableRow>

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#FF0000">
    </View>

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#FF0000">
    </View>

    <TableRow
    android:id="@+id/tableRow4"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center" >

    <TextView
    android:id="@+id/textView12"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_span="6"
    android:gravity="center"
    android:text="@string/Distance"
    android:textSize="18sp"
    android:textStyle="bold" >
    </TextView>

    </TableRow>

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#FF0000">
    </View>

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#FF0000">
    </View>

    <TableRow
    android:id="@+id/tableRow5"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >



    <TextView
    android:id="@+id/TextView13"
    android:gravity="center"
    android:text="@string/zero"
    android:textStyle="bold"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:typeface="serif" >
    </TextView>

    <view
    android:id="@+id/view43"
    android:layout_width="1dp"
    android:layout_height="32dp"
    android:background="#000000" />

    <TextView
    android:id="@+id/TextView15"
    android:gravity="center"
    android:text="@string/zero"
    android:textStyle="bold"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:typeface="serif" >
    </TextView>

    <view
    android:id="@+id/view44"
    android:layout_width="1dp"
    android:layout_height="32dp"
    android:background="#000000" />

    <TextView
    android:id="@+id/textView17"
    android:gravity="center"
    android:text="@string/zero"
    android:textStyle="bold"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:typeface="serif" >
    </TextView>
    </TableRow>

    <TableRow
    android:id="@+id/tableRow6"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >



    <TextView
    android:id="@+id/textView18"
    android:gravity="center_horizontal"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="@string/Overall" >
    </TextView>

    <view
    android:id="@+id/view45"
    android:layout_width="1dp"
    android:layout_height="32dp"
    android:background="#000000" />

    <TextView
    android:id="@+id/textView20"
    android:gravity="center_horizontal"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:text="@string/Thisweek" >
    </TextView>

    <view
    android:id="@+id/view46"
    android:layout_width="1dp"
    android:layout_height="32dp"
    android:background="#000000" />

    <TextView
    android:id="@+id/textView22"
    android:gravity="center_horizontal"
    android:text="@string/Today"
    android:textAppearance="?android:attr/textAppearanceLarge" />

    </TableRow>

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#FF0000">
    </View>

    <View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#FF0000">
    </View>


    </TableLayout>


    manifest

    package="com.example.wow"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

    <application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
    android:name=".MainActivity"
    android:label="@string/title_activity_main" >
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />

    <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
    </activity>
    </application>

    </manifest>


    Java

    package com.example.wow;


    import android.app.Activity;
    import android.os.Bundle;
    import android.view.Menu;



    public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
    }


    }
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    2
    Rep Power
    0

    Post output


    the output should be like this can't post it's real image


    ______________CALORIES_____________
    -------0 --------0-----------0---------
    ----Overall----This Week----TOday-----
    __________________________________
    __________Distance Travelled_________
    -------0--------0-----------0----------
    -----Overall----This WEek----tOday
    ___________________________________

IMN logo majestic logo threadwatch logo seochat tools logo