我想在按下返回按钮后启动我的应用程序(例如更新我的 TextView)。但它没有用。请帮我。
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
intentFilter = new IntentFilter();
intentFilter.addAction("SMS_RECEIVED_ACTION");
registerReceiver(intentReceiver, intentFilter);
}
protected void onPause() {
registerReceiver(intentReceiver, intentFilter);
super.onPause();
}
private BroadcastReceiver intentReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
sendSMS("123","message");
}
};