我有MainActivity
我可以得到很好的反应:
JSONObject responseVal = responseObj.getJSONObject("data");
message = responseVal.getString("id");
Log.i(TAG, "onResponse: " + message);
我有IntentService
并希望将message
值传递给它。
我尝试使用SharedPreferences
和intentPutExtra
,但它不起作用。
最好的方法是什么?
答案 0 :(得分:0)
如果您想将该消息存储到应用程序中,而不是用户共享优先使用其他方式使用getIntent.getextra()
和Intent i=new Intent(this,yourclass.class);
i.putExtra("demo",message);
方法。
yourclass.class
在String mes=getIntent().getStringExtra("demo");
textsize 2147483647
language us_english
dateformat mdy
datefirst 7
lock_timeout -1
quoted_identifier SET
arithabort SET
ansi_null_dflt_on SET
ansi_warnings SET
ansi_padding SET
ansi_nulls SET
concat_null_yields_null SET
isolation level read committed
答案 1 :(得分:0)
要将Truncation
发送到message
,请尝试以下操作:
IntentService
要接收Intent intent = new Intent(MainActivity.this, YourIntentService.class);
intent.putExtra("message", message);
startService(intent);
中的message
,请尝试以下操作:
IntentService