Click here to Skip to main content
15,890,282 members
Home / Discussions / Android
   

Android

 
SuggestionRe: App crash always. Why? Pin
Kornfeld Eliyahu Peter31-Jan-16 8:17
professionalKornfeld Eliyahu Peter31-Jan-16 8:17 
GeneralRe: App crash always. Why? Pin
Member 122634771-Feb-16 6:39
Member 122634771-Feb-16 6:39 
GeneralRe: App crash always. Why? Pin
Richard MacCutchan4-Feb-16 1:13
mveRichard MacCutchan4-Feb-16 1:13 
QuestionHow to inflate the youtubethumbnailview ? Pin
Member 1226347726-Jan-16 0:11
Member 1226347726-Jan-16 0:11 
AnswerRe: How to inflate the youtubethumbnailview ? Pin
Afzaal Ahmad Zeeshan26-Jan-16 0:34
professionalAfzaal Ahmad Zeeshan26-Jan-16 0:34 
Questioncant recive data from WebService via Android ksoap2 Pin
goldsoft24-Jan-16 9:18
goldsoft24-Jan-16 9:18 
AnswerRe: cant recive data from WebService via Android ksoap2 Pin
Afzaal Ahmad Zeeshan26-Jan-16 0:42
professionalAfzaal Ahmad Zeeshan26-Jan-16 0:42 
QuestionHow to retrieve data in sqlite with intent Pin
Muhammad H Alhasanat22-Jan-16 22:51
Muhammad H Alhasanat22-Jan-16 22:51 
Dears
I want to send data form one activity to another activity

i use intent to send data when i use on item click listener

this this my code for first activity

Java
<blockquote class="quote"><div class="op">Quote:</div>lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {


                Intent i = new Intent(getApplicationContext(),Details.class);
                i.putExtra("id",position);

                startActivity(i);

            }
        });</blockquote>


know the second activity
to get intnet is
Java
ublic class Details extends AppCompatActivity {
    DBAdapter myDbHelper = new DBAdapter(this);

    SQLiteDatabase database;

    int item;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_details);
        TextView t1=(TextView)findViewById(R.id.t1);
        ImageButton im=(ImageButton)findViewById(R.id.im);
        Intent data=getIntent();
        int des=data.getIntExtra("id", 1);
        //String s= String.valueOf(des);
        //
        // Cursor sq= myDbHelper.myDataBase.rawQuery("select * from sweet where description = '"+des+"')",null);
        try {
            //SELECT description  FROM sweet  where id =2
            //String query = "SELECT * FROM sweet WHERE " + des + " = name";
             String query = "SELECT description FROM sweet WHERE id = " + des + "";
                   database=myDbHelper.openDataBase();
                  database = myDbHelper.getReadableDatabase();
           //Cursor sq = myDbHelper.myDataBase.rawQuery("select * from sweet", null);
               Cursor cursor = database.rawQuery(query, null);
            cursor.getCount();
            cursor.moveToFirst();
               String description= cursor.getColumnName(2);
                t1.setText(description);
        }

know i want to use intent to use it in sql statment to search
in my table and get the details in the column description
and put the text of details in text view

can any one help me
AnswerRe: How to retrieve data in sqlite with intent Pin
Richard MacCutchan23-Jan-16 0:19
mveRichard MacCutchan23-Jan-16 0:19 
GeneralRe: How to retrieve data in sqlite with intent Pin
Muhammad H Alhasanat23-Jan-16 1:03
Muhammad H Alhasanat23-Jan-16 1:03 
QuestionRe: How to retrieve data in sqlite with intent Pin
David Crow23-Jan-16 11:03
David Crow23-Jan-16 11:03 
AnswerRe: How to retrieve data in sqlite with intent Pin
Muhammad H Alhasanat24-Jan-16 1:26
Muhammad H Alhasanat24-Jan-16 1:26 
QuestionRe: How to retrieve data in sqlite with intent Pin
David Crow25-Jan-16 2:48
David Crow25-Jan-16 2:48 
AnswerRe: How to retrieve data in sqlite with intent Pin
Muhammad H Alhasanat25-Jan-16 22:30
Muhammad H Alhasanat25-Jan-16 22:30 
GeneralRe: How to retrieve data in sqlite with intent Pin
David Crow26-Jan-16 2:04
David Crow26-Jan-16 2:04 
GeneralRe: How to retrieve data in sqlite with intent Pin
Richard MacCutchan26-Jan-16 2:30
mveRichard MacCutchan26-Jan-16 2:30 
QuestionWhat is the difference between creating instance like this? Pin
Member 1226347721-Jan-16 22:07
Member 1226347721-Jan-16 22:07 
AnswerRe: What is the difference between creating instance like this? Pin
Richard MacCutchan21-Jan-16 22:43
mveRichard MacCutchan21-Jan-16 22:43 
QuestionPull to Refresh in List view Android Pin
Tirumaleswara Reddy.K21-Jan-16 20:06
Tirumaleswara Reddy.K21-Jan-16 20:06 
QuestionRe: Pull to Refresh in List view Android Pin
David Crow22-Jan-16 2:41
David Crow22-Jan-16 2:41 
QuestionDoubts with HTTP request and responses in android Pin
Member 1226347721-Jan-16 19:02
Member 1226347721-Jan-16 19:02 
AnswerRe: Doubts with HTTP request and responses in android Pin
Richard MacCutchan21-Jan-16 22:40
mveRichard MacCutchan21-Jan-16 22:40 
GeneralRe: Doubts with HTTP request and responses in android Pin
Member 1226347721-Jan-16 22:46
Member 1226347721-Jan-16 22:46 
QuestionHow to add youtube thumbnail in list item ? Pin
Member 1226347713-Jan-16 22:04
Member 1226347713-Jan-16 22:04 
SuggestionRe: How to add youtube thumbnail in list item ? Pin
Richard MacCutchan14-Jan-16 2:52
mveRichard MacCutchan14-Jan-16 2:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.