۱۳۹۳/۱۰/۱۹, ۰۴:۲۴ ب.ظ
(۱۳۹۳/۱۰/۱۹, ۰۴:۰۷ ب.ظ)'aanndd' نوشته:کد پیاچپی:gridview.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v,
int position, long id) {
String position_string = "you pressed the item number " +String.valueOf(position+1) + " in GridView";
Toast.makeText(getApplicationContext(), position_string, Toast.LENGTH_SHORT).show();
}
});
وقتی به جای این کد:
کد پیاچپی:String position_string = "you pressed the item number " +String.valueOf(position+1) + " in GridView";
Toast.makeText(getApplicationContext(), position_string, Toast.LENGTH_SHORT).show();
این کدکد پیاچپی:startActivity(new Intent(MainActivity.this, Activity2.class));
رو قرار میدم has stop میدهد و خارج میشود
لازم به ذکر است که activity2 را در mainfest تعریف کردم
حال با تغییر
کد پیاچپی:
MainActivity.this