putExtra String Intent Android
|
public boolean onContextItemSelected(MenuItem item) {
AdapterContextMenuInfo info = (AdapterContextMenuInfo) item.getMenuInfo();
m = lv.getAdapter().getItem(info.position).toString();
Toast.makeText(getBaseContext(), \"You clicked !\"+m, Toast.LENGTH_SHORT).show();
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(\"Are you sure you want to delete this Fixture?\");
builder.setCancelable(false);
builder.setPositiveButton(\"Yes\", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//listAdapter.remove(m);
Intent i = new Intent(Afc.this.getApplicationContext(), WebViewExample.class);
i.putExtra(\"Key\", m);
startActivity(i);
}
//新课程活动WebView /////////////
Bundle extras = getIntent().getExtras();
String addOn = extras.getStringExtra(\"key\",m);
Toast.makeText(getBaseContext(), \"You clicked !\"+addOn, Toast.LENGTH_SHORT).show();
嗨,我正在传递一个带有意图的字符串,它在getStringExtra(\“ key \”,m);内部的变量m的新活动中给我一个错误。有人可以帮忙吗?
我这样做正确吗?
没有找到相关结果
已邀请:
2 个回复
辅奈
弓萍功