I’ve added a OnClick listener to the button in the fragment but when I click the button the app crashes and gives the error E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.streetsafe, PID: 10345 java.lang.NullPointerException: Attempt to invoke virtual method ‘boolean com.example.streetsafe.DatabaseHelper.insertData(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)’ on a null object reference at com.example.streetsafe.ui.report.ReportFragment.onClick(ReportFragment.java:57) public class ReportFragment ..
Category : onclicklistener
I need help, I need that when you click for each cell of RecyclerView after clicking it and switching to a new activity using onclick on this activity, the name of the object and detailed information was appearing, if there are ideas how this can be done on Kotlin without a database(I managed to transfer ..
I need help, I need that when you click for each cell of RecyclerView after clicking it and switching to a new activity using onclick on this activity, the name of the object and detailed information was appearing, if there are ideas how this can be done on Kotlin without a database(I managed to transfer ..
I have a fragment that shows the users details that I pull down from firebase. I am trying to set a OnClickListener so the logged in user can change their image but I cant seem to get it to work. I have look at the log Cat and can see no errors. I have look ..
I have a fragment that shows the users details that I pull down from firebase. I am trying to set a OnClickListener so the logged in user can change their image but I cant seem to get it to work. I have look at the log Cat and can see no errors. I have look ..
I’m working on an android application which shows a list view with data from SQL database. After a click on a list view element, a new Activity opens with information about it. I already implemented a Textwatcher to do the search in a list and the list is updated as it should work. The Problem ..
Is it possible to have an OnClickListener for a PreferenceCategory in a PreferenceFragment? I have tried things like this: XML <PreferenceCategory android:title="Nothing to see here folks" android:layout_width="wrap_content" android:layout_height="wrap_content" android:clickable="true" android:focusable="true" android:key="prefCatKey"> <SwitchPreference android:layout_width="wrap_content" android:layout_height="wrap_content" android:key="randomKey" android:title="Don’t do anything" /> </PreferenceCategory> Java PreferenceCategory prefCat = (PreferenceCategory)getPreferenceScreen().findPreference("RTXOffsetCategory"); prefCat.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() { @Override public boolean onPreferenceClick(Preference preference) { Log.d("Tag", ..
I have a layout container like described below: <ConstraintLayout android:id="@+id/container" …> <child1/> <child2/> <child3/> </ConstraintLayout> In my code, I have to attach a click listener to the container to be able to execute an action when the user clicks on any area of the container. What is the best solution to exclude the child2 from ..
I have three RecyclerViews in an activity, also having three buttons on top of activity , I want to go to specific RecyclerView on click of respective buttons on top of activity . how can be possible ??? Source: Android..
How to perform two events on one click? Is there anyone who can help with onClick events i want to add data and get location and add also that location on one click. Kindly help me in this Thanks in Advance Source: Android..
Recent Comments