Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue in load grid- android
    primarykey
    data
    text
    <p>I tried one simple prog. in it i add some details in the database and shown it in the grid... The details are adding but it does't shown in the grid.... its not loading in the grid..</p> <pre><code>public class ViewTask extends Activity { DatabaseActivity dbHelper; static public GridView grid; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.viewtask); grid=(GridView)findViewById(R.id.grid); try { grid.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) { // TODO Auto-generated method stub try { SQLiteCursor cr=(SQLiteCursor)parent.getItemAtPosition(position); String name=cr.getString(cr.getColumnIndex(DatabaseActivity.colTask)); String desi=cr.getString(cr.getColumnIndex(DatabaseActivity.colDesi)); String Startdate=cr.getString(cr.getColumnIndex(DatabaseActivity.colStartDate)); String Enddate=cr.getString(cr.getColumnIndex(DatabaseActivity.colEndDate)); Task tsk=new Task(name, desi, Startdate, Enddate); tsk.SetID((int)id); AlertDialog diag= Alerts.ShowEditDialog(ViewTask.this,tsk); diag.setOnDismissListener(new OnDismissListener() { public void onDismiss(DialogInterface dialog) { // TODO Auto-generated method stub //txtTest.setText("dismissed"); //((SimpleCursorAdapter)grid.getAdapter()).notifyDataSetChanged(); LoadGrid(); } }); diag.show(); } catch(Exception ex) { Alerts.CatchError(ViewTask.this, ex.toString()); } } } ); } catch(Exception ex) { } } public void LoadGrid() { dbHelper=new DatabaseActivity(this); try { //Cursor c=dbHelper.getAllEmployees(); //View v=spinDept1.getSelectedView(); //TextView txt=(TextView)v.findViewById(R.id.txtDeptName); //String Tsk=String.valueOf(txt.getText()); //Cursor c=dbHelper.getTskByDept(); //startManagingCursor(c); String [] from=new String []{DatabaseActivity.colTask,DatabaseActivity.colDesi,DatabaseActivity.colStartDate,DatabaseActivity.colEndDate}; int [] to=new int [] {R.id.colTask,R.id.colDesi,R.id.colStartDate,R.id.colEndDate}; SimpleCursorAdapter sca=new SimpleCursorAdapter(this,R.layout.gridrow,null, from,to); grid.setAdapter(sca); } catch(Exception ex) { AlertDialog.Builder b=new AlertDialog.Builder(this); b.setMessage(ex.toString()); b.show(); } } </code></pre> <p>}</p> <p>Any one can help to me.... where i did the mistake :(</p> <p>Thank you friends</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload