I have an app that is to register people into a platform but I get a response of Unauthenticated each time I submit the form data. The form is submitted using an API which requires a bearer token for each post request with the aid of retrofit. I have been out of touch with Java. Note: its just a plain
Tag: android
Call method when Application Closes
I know this is asked many times, but I want to clear things up In which activity should I place onDestroy()? Say I am in the MainActivity A and I move to activity B. But then I close the application while being on activity B. Does the onDestroy() method in MainActivity A get called? Or should I put an onDestr…
Android Java Play gifs only once time
I want geese when a user double-clicks on a post a gif is played. For this I used pl.droidsonroids.gif.GifImageView like so: and to get it started I just used visible and invisible when needed: obviously, however, the invisible is asynchronous with the seconds of the animation length. I’m looking for an…
Allow user to select only 3 items in recyclerview
Basically I want user to select only 3 items from a list in recyclerview My adapter class holder onclicklistener code: My model class: isSelected is used to get value of selected items in fragment. Any help would be appreciated. Answer Make a global varaible i.e numOfSelectedItems
Java OnClickListener not working in Android Fragment
I am trying to add a simple click on a button in a Fragment but the event is ignored. This is the code: I don’t know what is wrong in the code? Answer ok I have fixed this by using FragmentManager like :- for more details:- go to Android Studio – Fragment onClickListener not working
On Activity App Bar back pressed go to the parent activity with the fragment it was called
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 pr…
How do I create a new TextView and display it? (with programming)
I’m still new to Android Studio, and for practice I want to make a simple To-Do list app. I’m troubles with creating a new TextView and displaying it. I know that I probably need to manually insert the TextView into the layout, but I have no idea how to do that. Here’s my MainActivity code: …
Smali – lots of “move-object”
I’m using mt manager to edit Smali in dex. I found that there are many move-object in some classes, most of them are unnecessary. Does it impact performance? Answer Does it impact performance? No. The optimizer should eliminate any unnecessary moves when the smali code1 is compiled to native code. For what it…
How get all results from github search api?
I need to get all results with github search api with pagination using. Now I use request: https://api.github.com/search/repositories?q=lib&page=1&per_page=20 I read that the responses also includes the Link header which contains a ready-made URL to the next page. In response I have link https://api.g…
IndexOutOfBoundException when i pass arraylist to DBHelper to update database (Android SQlite)
I am new at android and trying to make managing members app with database. what i want to do here is that when user buys any drink it should change drinks name to “bought” in database, but when i pass Arraylist to db class it shows that my Arraylist is empty. userInputActivity here user selects dr…