I have a ListView and I'm using SimpleCursorAdapter to populate the content, and newView & bindView to get the View.
I want to enable that everytime the button on the row list is clicked, it loads an AlertDialog box.
Here's the code:
btn.setOnClickListener(new OnClickListener() {
public void onClick(View view) {
Intent intent = getIntent();
if (intent != null) {
Uri uri = intent.getData();
if (uri != null) {
Cursor cursor = managedQuery(uri, new String[] {
BaseColumns._ID, Database.Project.C_PRICE, Database.Project.C_KEYWORD,
Database.Project.C_SHORTCODE}, null, null, null);
if (cursor == null) {
finish();
} else {
if (cursor.moveToFirst()) {
AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
alertbox.setTitle("SMS");
I always get an error on this line: AlertDialog.Builder alertbox = new AlertDialog.Builder(this);
It says: The constructor AlertDialog.Builder(new View.OnClickListener(){}) is undefined
how am I able to do that?