[Solved] app crashing because of ‘Caused by: java.lang.NullPointerException’ error [closed]

Hey you are are getting exception on something like this code your_toggle_button.setChecked(true); The above code is in other class rather than your_toggle_button activity because you can’t touch your activity’s child if the activity is not running, to achieve this you will have to save your value in some variable and send it through intent when … Read more

[Solved] Register Broadcast receiver in Fragment PageViewer [closed]

No need to register fragment into manifest you can register receiver from fragment like this way private ScreenTimeOutReceiver mScreenTimeOutReceiver; mScreenTimeOutReceiver = new ScreenTimeOutReceiver(); registerReceiver(mScreenTimeOutReceiver, filter); 4 solved Register Broadcast receiver in Fragment PageViewer [closed]

[Solved] Android programming broadcastreceiver

I think you are only missing a small piece: String restoredText; String restoredname; public void addNotification(Context context) { getPref(context); String myString = restoredText + ” ” + restoredname; … .setContentText(myString) … } public void getPref(Context context) { restoredText = sp.getString(“purpose”, “”); restoredname = sp.getString(“name”, “”); } solved Android programming broadcastreceiver

[Solved] Start and Close single Activity from BroadcastReceiver

You could try to directly kill an activity by calling a static method in that activity: Activity A should have a variable static ActivityA activityA; In onCreate state: activityA = this; and add this method: public static ActivityA getInstance(){ return activityA; } In activity B, call the fuction getInstance() ActivityA.getInstance().finish(); solved Start and Close single … Read more

[Solved] What does Error:(13) Error: The element must be a direct child of the element [WrongManifestParent] mean and how do i fix it?

Move <receiver android:name=”.receiver.DialReceiver” android:exported=”true” android:process=”:background” > <intent-filter> <action android:name=”android.intent.action.NEW_OUTGOING_CALL” /> <category android:name=”android.intent.category.DEFAULT” /> </intent-filter> </receiver> Outside <activity> tag 2 solved What does Error:(13) Error: The element must be a direct child of the element [WrongManifestParent] mean and how do i fix it?

[Solved] automatically sms read not working in android

For Xiaomi Permission Dialog Use this Read all SMS private void displaySmsLog() { Uri allMessages = Uri.parse(“content://sms/”); //Cursor cursor = managedQuery(allMessages, null, null, null, null); Both are same Cursor cursor = getActivity().getContentResolver().query(allMessages, null, null, null, null); if (cursor!=null) { while (cursor.moveToNext()) { for (int i = 0; i < cursor.getColumnCount(); i++) { Log.d(cursor.getColumnName(i) + “”, … Read more