Android Application: Problem with Java!

Closed
Report
Posts
1
Registration date
Thursday July 4, 2013
Status
Member
Last seen
July 4, 2013
-
Posts
15208
Registration date
Monday July 11, 2005
Status
Moderator
Last seen
January 17, 2022
-
Good Morning:
I'm working in eclipse software and having a problem in displaying my database on a listView by using java to make an android application please I need your help as soon as possible because i have a project for tomorrow:
this is my coding
the name of my database : database
the table's name is Donators
everything is wriitin on a page called page2.java
just i have this problem:
***ListView1**
package com.bloodbankservices.blooddonation;

import com.bloodbankservices.blooddonation.db.DBHandler;
import com.bloodbankservices.blooddonation.vo.NameVO;

import android.os.Bundle;
import android.app.Activity;
import android.app.ListActivity;
import android.app.LoaderManager.LoaderCallbacks;
import android.content.Loader;
import android.database.Cursor;
import android.support.v4.widget.SimpleCursorAdapter;
import android.view.Menu;
import android.widget.ListView;

public class List extends ListActivity implements LoaderCallbacks<Cursor> {

SimpleCursorAdapter mAdapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_list);

(problem)*** List names = (List) Page2.handler.getAllNameVO();
ListView list_view = (ListView) findViewById(R.id.listView1);


//mAdapter = new SimpleCursorAdapter
//(this, android.R.layout.list_content, names);list_view. *** (here is the problem how to display a list in listview android)(problem)



;


}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_list, menu);
return true;
}

@Override
public Loader<Cursor> onCreateLoader(int arg0, Bundle arg1) {
return null;
// TODO Auto-generated method stub
//return null;
}

@Override
public void onLoadFinished(Loader<Cursor> arg0, Cursor arg1) {
// TODO Auto-generated method stub

}

@Override
public void onLoaderReset(Loader<Cursor> arg0) {
// TODO Auto-generated method stub

}

}

and if any errors are present please could u fix it ?

Thank You Very Much !

2 replies

Posts
15208
Registration date
Monday July 11, 2005
Status
Moderator
Last seen
January 17, 2022
1,545
Hello,
What kind of data do you want to display?
You must create your adapter to correctly display your data.

Edit: Maybe something like this

@+
Buno, Modo CS-CCM
L'urgent est fait, l'impossible est en cours. Pour les miracles, prévoir un délai...
0
Posts
15208
Registration date
Monday July 11, 2005
Status
Moderator
Last seen
January 17, 2022
1,545
Oops...
i didn't pay attention at the date...
Hope you have solved your problem ^^
0