Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old July 8th, 2013, 06:23 PM   #1 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jan 2013
Posts: 53
 
Device(s):
Carrier: Not Provided

Thanks: 11
Thanked 1 Time in 1 Post
Default what are the steps in make a onListItemClick

hey yall
what is the int position for?

i have this in my listactivity and the below code in my edit class.
i cant seem to figure out what im soposed to put in place of employee_id.
thanks all

Code:
 
public
void onListItemClick(ListView parent, View view, int position, long id) {
Intent intent = new Intent(this, addstuff.class); Cursor cursor = (Cursor) adapter.getItem(position);
intent.putExtra("EMPLOYEE_ID", cursor.getInt(cursor.getColumnIndex("_id"))); startActivity(intent);
}
public
class addstuff extends Activity{
protected EditText have1;
protectedintsupplyId; privatestaticfinal String DATABASE_TABLE = "mysupplystable";
publicstaticfinal String KEY_ITEMS = "items"; publicstaticfinal String KEY_ROWID = "_id";
@Override publicvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); setContentView(R.layout.mysupply_edit);
supplyId = getIntent().getIntExtra("_ID", 0); SQLiteDatabase db = (new DatabaseHelper(this)).getWritableDatabase();
Cursor cursor =db.query(true, DATABASE_TABLE, new String[] {KEY_ROWID, KEY_ITEMS}, KEY_ROWID + "=" + supplyId, null,
null, null, null, null);
if (cursor.getCount() == 1) {
cursor.moveToFirst();
have1 = (EditText) findViewById(R.id.have1); have1.setText(cursor.getString(cursor.getColumnIndex("items")));
}
}
}

flyhigh427 is offline  
Last edited by flyhigh427; July 9th, 2013 at 06:01 AM. Reason: edit tags
Reply With Quote
sponsored links
Old July 8th, 2013, 08:13 PM   #2 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jan 2013
Posts: 53
 
Device(s):
Carrier: Not Provided

Thanks: 11
Thanked 1 Time in 1 Post
Default

i guess position means screen position and id is for coloums right?
so how do you know witch row id your on in a listview ,if its scrolling ?
flyhigh427 is offline  
Reply With Quote
Old July 9th, 2013, 12:58 AM   #3 (permalink)
Senior Member
 
out of ideas's Avatar
 
Join Date: May 2012
Posts: 608
 
Device(s): ZTE Merit. ICScamwich OC. Galaxy Prevail CTMod 3.68
Carrier: Pigeons

Thanks: 58
Thanked 138 Times in 108 Posts
Default

you have your listitem click after oncreate right? nothow it looks in that post.

the row id stays the same if you scroll or not.
__________________
Stuff of mine:
Ice Cream Scamwich (ZTE 990s)

Deodexed Stock ZTE Merit
out of ideas is online now  
Reply With Quote
The Following User Says Thank You to out of ideas For This Useful Post:
flyhigh427 (July 9th, 2013)
Old July 9th, 2013, 05:57 AM   #4 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jan 2013
Posts: 53
 
Device(s):
Carrier: Not Provided

Thanks: 11
Thanked 1 Time in 1 Post
Default

hey out of ideas what does the emp and mgr stand for when using rawqueary?
many thanks
flyhigh427 is offline  
Reply With Quote
Old July 9th, 2013, 06:04 AM   #5 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jan 2013
Posts: 53
 
Device(s):
Carrier: Not Provided

Thanks: 11
Thanked 1 Time in 1 Post
Default

hey when i wrap code in code tags i have to type in code why?
flyhigh427 is offline  
Reply With Quote
Old July 9th, 2013, 08:20 PM   #6 (permalink)
Senior Member
 
out of ideas's Avatar
 
Join Date: May 2012
Posts: 608
 
Device(s): ZTE Merit. ICScamwich OC. Galaxy Prevail CTMod 3.68
Carrier: Pigeons

Thanks: 58
Thanked 138 Times in 108 Posts
Default

I dont know never used rsawquery.

cuz code belong in code
out of ideas is online now  
Reply With Quote
Old July 9th, 2013, 09:38 PM   #7 (permalink)
Junior Member
Thread Author (OP)
 
Join Date: Jan 2013
Posts: 53
 
Device(s):
Carrier: Not Provided

Thanks: 11
Thanked 1 Time in 1 Post
Default

i got it i think now im stuck again
flyhigh427 is offline  
Reply With Quote
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 10:00 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.