Using java Syntax Highlighting
- class DataBaseWork extends ListActivity
- {
- .
- .
- .
- .
- .
- .
- public void FillData()
- {
- Cursor c= GetAllRows();
- startManagingCursor(c);
- ListAdapter adapter = new SimpleCursorAdapter(
- this,
- R.layout.displaylog,
- c,
- new String[] {"login_time", "serverIP"},
- new int[] {R.id.col1,R.id.col2}
- );
- this.setListAdapter(adapter);
- }
- .
- .
- .
- .
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
the 'databasework' is not an activity.. the 'test' class shown below is the subactivity not the main one..
i am calling the filldata() method from 'test' class :
Using java Syntax Highlighting
- public class test extends Activity {
- DataBaseWork dbw;
- @Override
- public void onCreate(Bundle icicle) {
- dbw = new DataBaseWork(this);
- super.onCreate(icicle);
- dbw.FillData();
- TextView col1 = (TextView)findViewById(R.id.col1);
- TextView col2 = (TextView)findViewById(R.id.col2);
- setContentView(R.layout.displaylog);
- }
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
cannot figure out what the problem is.. but when i comment out filldata(), the exception error vanishes.. so the problem lies there i guess.. hav wasted a lot of time on this.. plz help..
here is one of the relevant xml files i am using..
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- >
- <TextView id="@+id/col1"
- android:layout_width="130sp"
- android:layout_height="wrap_content"
- android:textSize="10sp"
- android:text="Login Time"
- />
- <TextView id="@+id/col2"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:textSize="10sp"
- android:text="Server Address"
- />
- </LinearLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4

this is java 

