Category : onclicklistener

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 ..

Read more

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 ..

Read more

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", ..

Read more