Categories
Mastering Development

How to move the data that I have called from the Firebase real-time database, in a listview to another activity in android studio?

So, I have a simple listview application. When I click an item, it will send the data to the next activity using Bundle. In the first time, I use this JSON structure "teacher": [ { "name": "Carl", "age": "40" }, { "name": "Johnson", "age": "44" } ], And this is my Java code: Query query […]

Categories
Mastering Development

Search function unable to get correct item position

This is my homepage with the search funtion: public class Admin extends AppCompatActivity { ListView _admin_listview; Admin_Adapter AA; Homepage_ListView homepageListView; private final Handler handler = new Handler(); public static ArrayList<Homepage_ListView> UserArrayList = new ArrayList<>(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_admin); ActionBar actionBar = getSupportActionBar(); actionBar.setTitle("Admin Homepage"); _admin_listview = (ListView) findViewById(R.id.admin_listview); retrieveData(); doTheAutoRefresh(); AA […]

Categories
Mastering Development

RecyclerView ItemClickListener is not working in OnBindViewHolder

how to get a particular textview’s getText(string) when clicked in RecyclerView ? I have tried like holder.itemview.setOnclickListener in OnBindViewHolder but nothing i see in log. I got solution for this but it only works with double click. Any solution for single click ??? Please check my adapter class code below public class AddressAdapter extends FirestoreRecyclerAdapter<AddressModel, […]

Categories
Mastering Development

Android, delete item in list and in sqllite java

Hey everyone I’m having a list and a popup where I can click on delete. How can I delete the item which I long click in my list –> This list is stored in the local sqllite db. I wanna click delete to delete the Edinbourgh item but when the click occurs, nothing happens just […]

Categories
Mastering Development

How can I get all the data FirebaseRecylerAdapter android studio realtime database

I’m using the Firebase Realtime Database with Android Studio. Code java. I use a real-time database. I try to bring all the posts of the people the user is following. but i can’t bring all the posts . Only the last posts sent by users is coming I have this database: Post class : public […]

Categories
Development

anychart doen’t change with data

I’m trying to use anychart with a data stored in firebase, i added a spinner to filter the data i used log.e to know if my data changes and i conclude that the data changes pretty good but the problem is my pie chart doen’t update with the new data this is my code protected […]

Categories
Development

RecyclerView takes time loading Adapter values in a Fragment

I have a Fragment (HealFragment) with RecyclerView which it’s adapter is a different class retrieving data from Firestore thanks to FirestoreRecyclerAdapter and it’s working good. But whenever I switch to this HealFragment it stutters(slows down) a little bit trying to set the adapter to the RecyclerView. This happens because I set the adapter of the […]

Categories
Development Linux Ubuntu

Can anyone help me please? I’m beginner

this is the student_list and this is the error. 2019-12-12 00:08:44.420 20329-20329/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.ara_silva, PID: 20329 java.lang.NullPointerException: Attempt to invoke virtual method ‘android.database.Cursor com.example.ara_silva.SQLiteHelper.getData(java.lang.String)’ on a null object reference at com.example.ara_silva.student_list$1$1.onClick(student_list.java:123) at androidx.appcompat.app.AlertController$AlertParams$3.onItemClick(AlertController.java:1068) at android.widget.AdapterView.performItemClick(AdapterView.java:318) at android.widget.AbsListView.performItemClick(AbsListView.java:1158) at android.widget.AbsListView$PerformClick.run(AbsListView.java:3127) at android.widget.AbsListView.onTouchUp(AbsListView.java:4054) at android.widget.AbsListView.onTouchEvent(AbsListView.java:3813) at android.view.View.dispatchTouchEvent(View.java:11776) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2962) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2643) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2968) […]

Categories
Development

FirestoreRecyclerView Swipe CardView to Delete the Document

I have the following code inside onStart() method of a Fragment: final FirestoreRecyclerAdapter adapter = new FirestoreRecyclerAdapter<NewTask, TasksViewHolder>(options) { @Override protected void onBindViewHolder(@NonNull final TasksViewHolder holder, final int position, @NonNull NewTask model) { holder.setTaskTitle(model.getTaskTitle()); holder.setTaskPrivacy(model.isTaskPrivacy()); holder.setTaskColor(model.getTaskColor()); //<—– ONCLICK OF A TASK —–> holder.mView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final DocumentReference ref = […]

Categories
Development SQL

How to delete item if exist using sqlite?

I spend much time on SQLite and I have a problem in deleting an item if it exist! I’m working in Bookmark App that save links from webview into listview using SQLite, my problem is can’t check if the item is exist > don’t create a link. this is my BookmarksDatabase used for sqlite: public […]