-2

/t is using for tab /n is using for next line then what is use for next column

shubham gupta
  • 27
  • 1
  • 1
  • 8

2 Answers2

0
public void read(View v) {
        Cursor c = dBase.query("employee", null, "id=?", new String[]{ET1.getText().toString()}, null, null, null);

        while (c.moveToNext()) {
            Toast.makeText(getApplicationContext(),
                    c.getInt(0) + "\n" +
                            c.getString(1) + "\n" +
                            c.getString(2) + "\n" +
                            c.getString(3),
                    Toast.LENGTH_LONG).show();
        }

        ET1.setText("" + c.getInt(0));
        ET2.setText("" + c.getString(1));
        ET3.setText("" + c.getString(2));
        ET4.setText("" + c.getString(3));

        Intent i = new Intent(this, AnotherActivity.class);
        i.putExtra("1", "");
        i.putExtra("2", "");
        i.putExtra("3", "");
        i.putExtra("4", "");
        startActivity(i);

        /*write this Code in another activity after SetContentView();  to display data */

        Log.e("1", getIntent().getStringExtra("1"));
        Log.e("2", getIntent().getStringExtra("2"));
        Log.e("3", getIntent().getStringExtra("3"));
        Log.e("4", getIntent().getStringExtra("4"));
    }
Mayur Gangurde
  • 1,552
  • 12
  • 22
PRATEEK BHARDWAJ
  • 2,364
  • 2
  • 21
  • 35
0

1.Change the return type of your read class to get the data in other activity

2.Make object of your database class and read data from that object Example YourDBClass db=new YourDBClass(); String[] result=db.read();

SFAH
  • 624
  • 15
  • 35