0
我想要當用戶嘗試打開Settings
應用程序或包com.android.settings
(所有應用程序在Settings
像電池,wifi,聲音等),它會顯示Toast
。我將在Service
中創建。這裏是我的代碼:android:檢測設置(com.android.settings)是否打開
public int onStartCommand(Intent intent, int flags, int startId) {
Toast.makeText(this, " MyService Started", Toast.LENGTH_LONG).show();
//if(Settings is open){
//Toast.makeText . . .
}
return START_STICKY;
}
我已經全部在stackoverflow
,但仍然無法正常工作。我爲我的英語道歉,如果你提出解決方案,我會很高興。謝謝。 。
很好。 。有用。 Thx兄弟,你救了我的生命 – dtnder 2014-08-28 16:51:15
對不起,但爲什麼總是顯示'吐司'。我只是想當用戶點擊「設置」或「Wifi」。 。 – dtnder 2014-08-28 17:15:27
@dtnder它顯示了設置包啓動時的敬酒,就像你問的那樣。 – Simas 2014-08-28 17:17:16