How to print own text like"Enter valid ID", If Cursor return null value?
<p>Any one help me. I want to print some suggestion if Cursor value return as null.
This is method of helper class for display data for corresponding ID</p>

<pre><code>public Cursor display(int id) {

// TODO Auto-generated method stub

DBHelper=new DatabaseHelper(context);

db=DBHelper.getReadableDatabase();

Cursor mCursor =

               db.query(true, DATABASE_TABLE, new String[] {KEY_ROWID,
                  KEY_ISBN}, KEY_ROWID + "=" + id, null,
                   null, null, null, null);
                if (mCursor != null) {
                  mCursor.moveToFirst();
                }

                return mCursor;
</code></pre>

<p>and this is my activity class from where iam calling display()</p>

<pre><code>public void onClick(View v) {

// TODO Auto-generated method stub

int id=Integer.parseInt(inputid.getText().toString());


DBAdapter dbadapter = new DBAdapter(v.getContext());

 Cursor c=dbadapter.display(id);

 if(c!=null)

 Toast.makeText(this, "Name: " + c.getString(1) , Toast.LENGTH_LONG).show();

 else

 Toast.makeText(this, "Enter Valid ID", Toast.LENGTH_LONG).show();

}
</code></pre>
