Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
setContentView(R.layout.display_records);
        ArrayList<String> array_list = helper.getallData();

        Log.d("array_list", "Dispaly Record");
        Log.i("array_list", "array_list");

        ArrayAdapter<String> array_adapter = new ArrayAdapter<String>(this, R.layout.display_records, array_list);
        list_view = (ListView) findViewById(R.id.list_view);
        list_view.setAdapter(array_adapter);

        list_view.setOnItemClickListener(new OnItemClickListener() {

            @Override
            public void onItemClick(AdapterView<?> arg0, View arg1,
                    int arg2, long arg3) {
                // TODO Auto-generated method stub
                int id = arg2 + 1;
                Bundle dataBundle = new Bundle();
                dataBundle.putInt("id", id);
                Intent intent = new Intent(getApplicationContext(),
                        DBHelper.class);
                intent.putExtras(dataBundle);
                startActivity(intent);

            }
        });

i Do like this bt it's cant working ... getting me error is Unable a to Start Activity ..
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900