I’m having an issue that maybe is happening to other community members and I wanted to ask if somebody knows the solution. I have an app with these Two activities (MainActivity, UserProfileActivity). The MainActivity contains a NavigationDrawer that navigates through fragments. So here it’s the problem. While navigating in the second fragment and pressing a button in that fragment. It
I want to pass the list of itemselected or ItemsInCart to another activity. My Items Model implements parcelable. The problem is am getting error below in my SecondActivity class. Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘void androidx.recyclerview.widget.RecyclerView.setLayoutManager(androidx.recyclerview.widget.RecyclerView$LayoutManager)’ on a null object reference at com.example.Project1.SecondActivity.onCreate(SecondActivity.java:59) Below is the code Model Item; } First Activity; The list that i want
I tried this way: The application stops working on setResult only when the arraylist is not empty. SECONDARY ACTIVITY Intent d = new Intent(); d.putExtra(“cat”,(Serializable) category….
I’m fetching an image from a URL as a bitmap using glide, and onResourceReady() I’m trying to share the image via intent, but I’m getting an exception. I’m using Android 30. Glide.with(this) ….
I use the library zxing-android-embedded in my Android App. Before calling initiateScan() method to start the scanner from my activity, I set a class variable scanedItemId to know on which item I …
I want to open the share via option from the service class. It is working fine in Android 7, but in 8+ OS it starts showing android.util.AndroidRuntimeException: Calling startActivity() from …
I’m trying to send an e-mail from my Android App. With the click on a button, gmail should open and show a new email with my previously defined recipient, subject and email body. So far I’ve tried sending the Intent.ACTION_VIEW as well as Intent.ACTION_SENDTO. Both show my draft with the recipient only. Both subject and message are being opressed. Weird
I am trying to get images from my Gallery and upload them to the server. I want to allow the user to select multiple images from gallery. when I select two or more images it works very well. But when …
How to get a heads up notification.With below code i can only see three dots on status bar and a notification in notification bar. Answer I was having the same problem, but I was using the newer NotificationCompat.Builder() call which requires a channel ID from a NotificationChannel. The notification will only appear as a heads-up notification if the NotificationChannel is
I want to save data using Shared Preferences in android. But I am looking to use separate class to do this task. I have implemented that class like below, But there is an error on getActivity(), How to solve this? Thanks Answer getActivity() is a method of Fragment not of your SavePref. In your case the simple fix is to