2018-10-22         Maureen

accessing an adapter's data via another adapter

Is it all possible to access an adapter's data via another adapter?I want to start an activity and pass data from an adapter to a fragment which is used in TabLayout as one of three fragments, I have two adapters and a button which is clicked to start an activity, its Java code is in my first adapter and I need to pass second adapter's data via second adapter itselfhere is my codes:my first adapter:public class RecyclerViewDataAdapter extends RecyclerView.Adapter<RecyclerViewDataAdapter.ItemRowHolder>{ private ArrayList<SectionDataModel> dataList; private ...

 android                     1 answers                     10 view
 2018-10-22         Regan

Admob integration with AppCompatActivity

I am struggling to add admob to my application which is based on AppCompatActivity. I have tried several ways like autogenerated way (admob) some how not succeed. Below is the main activity class for reference. public class WorldClockActivity extends AppCompatActivity { private static final boolean IS_GINGERBREAD = Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD; /** * ATTENTION: This was auto-generated to implement the App Indexing API. * See https://g.co/AppIndexing/AndroidStudio for more information. */ private GoogleApiClient client; ...

 android                     1 answers                     12 view
 2018-10-22         June

Flutter - Trying to get the scaffold of a widget context from reducer

I am hitting a wall since I am trying use the context (to call a snackbar when the async action is done) of a widget from a reducer.I have tried using GlobalKey, but when I get such key and I try to use the context of it to call the widget Scaffold it throws an error which says there is no Scaffold for such context, when there is infact.Sadly I cannot provide the code because is for a customer and the code cannot be shown, but I can provide you with the details if it is needed.The snackbar/toast itself is not that important, but if the context of a widget cannot be get from...

 android                     2 answers                     16 view
 2018-10-22         Belle

Visual studio code can't detect emulator device or phone connected

I was running my app with vscode using Android emulator or my phone, however all of a sudden vscode could not identify any device or emulator that I connect (no devices). phone is in debug mode or even the android emulator. Also When I try starting the emulator I get this warning Seems like adb can't be found. Have you updated or moved the (Android) SDK recently?You may want to check your platform-tools folder in your Android SDK and if necessary, download the tools again (see this answer). [XXX]

 android                     1 answers                     24 view
 2018-10-22         Elizabeth

How to make parsed color lighter?

Actually in my RecyclerView Adapter i set the background color by doing holder.itemView.setBackgroundColor(Color.parseColor(currentItem.getSfondo()));Where the parsed color is given from the DB and till this moment all works perfectly but now i've added a bottom bar to my cardView where i will display a price so i would be able to get the same color from the itemView so Color.parseColor(currentItem.getSfondo()) but make it lighter by adding some alpha or idk so the user will be able to divide the text from the price. So something like that I use these methods.lighten(C...

 android                     1 answers                     65 view
 2018-10-22         Wright

Custom progress bar is cut in bottom

I can't figure out what the problem is. I am trying to make this possible in every screen size but I'm stuck here.This is the problem:the layout is big enough but the progress is cut therebelow there is the code. How can I fix it? ... <LinearLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1"> <CustomProgressBar android:id="@+id/progressBarBPM" android:layout_width="0dp" android:layout_weight="1" android:layout_height="match_parent"/> ...

 android                     1 answers                     67 view
 2018-10-22         Dale

How to manage click on marker which is not in Cluster in Android Google Map API?

I am having trouble implementing OnClickListener for Marker(s) which are not in Cluster, i.e. not added using: mClusterManager.addItem(markerCluster);I have set OnMarkerClickLister as follows: mMap.setOnCameraIdleListener(mClusterManager); mMap.setOnMarkerClickListener(mClusterManager);If I just use: mMap.setOnMarkerClickListener(new GoogleMap.OnMarkerClickListener() { @Override public boolean onMarkerClick(Marker marker) { return false; } });the click on markers is not working at all.For example: I have this situation:Two green dots and b...

 android                     1 answers                     67 view
 2018-10-22         Dylan

How to get last item view from RecyclerView after adding new item and notifyDataSetChanged?

Not able to get last item view after adding new item into adapter and notifyDataSetChanged.Getting null item view when I am going to get last item view from RecyclerView after calling notifyDataSetChanged().Following some scenario for getting item view object but not able to get exact view object but size and item count is correct.Scenario 1:mListItem.add("Hello Data");mAdapter.notifyDataSetChanged();mRecyclerView.scrollToPosition(mAdapter.getItemCount() - 1);View itemView= mRecyclerView.getChildAt(mAdapter.getItemCount()-1);above itemView is always getting null value.Scena...

 android                     1 answers                     76 view
 2018-10-22         Abigail

Why is bind being called in my RecyclerView when I click a button for the first time?

I have a RecyclerView where each ViewHolder contains a nested Linear Layout with some TextViews and a button. (The button is a Facebook ShareButton but I see the same behavior with a regular Button as well.) When I click the ShareButton once, nothing happens. When I click it again, it is successful.Some clues:Other answers on stackoverflow say to set the button's focusable and focusableInTouchMode to false -- this has not made a difference in my case.By using some print statements, I see that the first time I click the button, it calls bind again on each ViewHolder.If I min...

 android                     1 answers                     78 view
 2018-10-22         Edmund

I have implemented searchview using with recyclerview but I am getting error?

I have implemented SearchView with RecyclerView but I am getting an error. I am developing android weather app and I want to implement function when user launch app user can search cityName when the user hits names it should display cityName and weather information a user can also add city add and remove it but I have followed this tutorial for SearchView searchviewtutorialbut I am getting this error at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android....

 android                     2 answers                     79 view
 2018-10-22         Eli

How to share specific 1 card view of activity from Android App programmatically like Google Analytics App

I am working on an android app of social network and i am stuck at one place.I want to share specific card view from an activity to facebook or whatsapp wherever user wants to share as an image like google analytics app.check screenshot belowSuppose i want to share top 2 card then i can share like this to whatsapp or fb whever i wantFirst cardSecond cardFirst i thought to take screenshot of app and share it to user's social app but it doesn't match to requirements and i have no idea how can we achieve this.Help me to solve this problem. You cannot share a 'Card' to other...

 android                     3 answers                     79 view
 2018-10-22         Leopold

Function inside the card view Android

In the below function, CardView has to show the score, but its not changing according to value(if equal score is 10 if not score is 1.)but I'm getting only the difficult value 1public void getOppositeUsers22(){ usersDb.addChildEventListener(new ChildEventListener() { @Override public void onChildAdded(DataSnapshot dataSnapshot, String s) { if (dataSnapshot.child("post").getValue() != null) { if (dataSnapshot.exists() && !dataSnapshot.child("connections").child("nope").hasChild(currentUId) && !da...

 android                     2 answers                     82 view
 2018-10-22         Roberta

Update RecyclerView List after adding a row and also set user entered values from that row to the recyclerview list

I have a recyclerview that contains cardViews with edittext, datepicker & spinner. Each cardview has (+) button which can be used to add a new cardview to the recyclerview. The problem that i am facing is that i want to get values from all the cards available in recyclerview including the newly added card into an object type arraylist. For the time being i am able to add a new blank card but not able to catch user entered values from that card into list.I want to save the above pink marked values into the recyclerview list so that i can save it to server using rest api....

 android                     1 answers                     90 view
 2018-10-22         Salome

How to make RecyclerView inside CardView and CardView have it's size when it has low items

I have a RecyclerView inside a CardView but i have problem that i have 2 buttons in bottom of the RecyclerView so i put them at the end of RelativeLayout and give them parent_bottom true so i can make them visible but that makes the CardView have the full screen whether the RecyclerView have items of not.Xml code:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="match_parent"android:layout_height="match_parent"xmlns:app="http://schemas.android.com/apk/res-auto"><android.support.v7.widget.CardView android:layout_width...

 android                     4 answers                     92 view
 2018-10-22         Fanny

Why sending content by intent does not work

I have an activity that contains many posts in a recyclerview and each post placed in a cardView (posts are getting from my database in my host). I wanted to use sending intent to share any of posts. My share button works but works in a wrong way.For example when I click to share my first post, it shares the third post! and when I click to share the seventh post, it shares the tenth post and so on. What wrong with it? anyone can help?This is my xml: <ImageButton android:id="@+id/send_post" android:layout_width="50dp" android:layout_height="50dp" ...

 android                     1 answers                     93 view
 2018-10-22         Adonis

Why I can't record first and last records on an array to Firestore

I am trying to register 20 users and create a document on my collection for each of them on Firebase Firestore. My program successfully registers 20 users but fails when creating documents for them. 18, 19 documents created each time but it almost always skip to create a document for the first member and the last member of my array. StudentCreator is just a file that has a parent array, student array with 20 items.Here is an array from studentCreator.javapublic static String parent_names[]={ "Ahmet Lola", "Hüseyin Kutlutürk", "Ümit Uğrak", ...

 android                     1 answers                     19 view

Page 2 of 4922  |  Show More Pages:  Top Prev Next Last