我在这一行上收到错误:
Intent intent = getIntent();//erroris: create method getIntent()
请帮帮我,如果有人知道这个错误会在什么情况下调用?
我的代码部分:
发件人方:
if (intent.getStringExtra("code").equals("promo"))
{
String promocode = intent.getStringExtra("promocode");
String isSMS = intent.getStringExtra("issms");
String smsContent = intent.getStringExtra("smscon");
String opCode = intent.getStringExtra("opcode");
//send data
Intent i=new Intent();
i.putExtra("PROMOCODE", promocode);
i.putExtra("SMSCONTENT", smsContent);
i.putExtra("OPCODE", opCode);
接收方:
Intent intent = getIntent();
String promoCode = intent.getStringExtra("PROMOCODE");
String smsContent = intent.getStringExtra("SMSCONTENT");
String opCode = intent.getStringExtra("OPCODE");
String sql = "CREATE TABLE IF NOT EXISTS notifications (" +
"_id INTEGER PRIMARY KEY AUTOINCREMENT, " +
promoCode + "INTEGER," +
smsContent + "TEXT," +
opCode + "INTEGER);";
答案 0 :(得分:0)
获取值时,请使用: -
String promocode = getIntent()。getStringExtra(“promocode”);
根据要求更改密钥(“promocode”)。
告诉我这一点是否有助于你......