I have an activity that requires an internet connection, and I put a progress bar for loading pages, but when there is no internet connection from the user the progress bar is always VISIBLE, like the code below and what I want is, when there is no internet connection, the progress bar has the status of GONE and immediately showing
Tag: android-studio
How to print data from csv file onto secondactivity?
I’m creating an app which has a csvfile stored in its Raw resource folder and when I click on a button in main Activity , it should print the data of the csvfile in second Activity. But when I launch …
Android Web View looks weird on Tablet but fine on emulator in Android Studio
I made a WebView and the site looks completely fine on the Emulator but when I install the APK on my Samsung Galaxy Tab A it looks really messed up. This is what it’s supposed to look like: and this …
How to make addListenerForSingleValueEvent to work in loop?
I’m trying to access the addListenerForSingleValueEvent for a specific number of times based on the amount of item’s present in cart but since it listen’s for only one time I’m unable to fetch the …
How to reset autoincrement value after deleting 1 row of column from it, on sqlite java android?
on MYSQLI this method is work on me back then, ALTER TABLE tablename AUTO_INCREMENT = 0, this will reset on last autoincrement position but i don’t know how to do it on SQLITE, so the idea is, i want to delete 1 row column table, and at the same time i want to reset auto increment value to the last
Why is this happening on my code although I did not return any value from a method?
I wrote some Java code; This code is working fine. When I press + and – buttons on app, it is executing increment and decrement methods. But in those methods, I used void. Which I learned that means “no return” on that method. So, how can this code works as showing the quantity variable changed; although it was changed in
onCreateOptionsMenu not being called
onCreateOptionsMenu does not get called in a fragment. I have to manually call setHasOptionsMenu(true) in onCreatedView() but this causes the item.itemId be an empty String “” in the onOptionsItemSelected() and therefore i can’t detect which menu item was tapped. I’m currently using this in a fragment: Answer Call super.onCreateOptionsMenu(menu,inflater) after menu inflate This may more help Ref :: https://stackoverflow.com/a/15654039/11393354 try
How to parse JSON data without define array in JSON in Android Studio
I am new in Android I am trying to develop an application which is used to validate ifsc code by entering code in edit text. So in this project, I am using Razorpay JSON to fetch data but when I fetch data it shows in JSON format not readable format. How to convert JSON data in a readable format? My
How to make a program show a toast instead of crashing?
I am working on an app. Here’s a small fragment which converts the entered string to a fraction: This works pretty well, provided you enter the number in the correct format. However, if we mess up the format, example, inserted 2 spaces or ‘/’, the app crashes and closes. I want that if the program encounters a problem in this
How to make textviews visible depending on progress of seekbar
I am trying to make 4 different textviews visible depending on the progress of my seekbar (one visible at a time). I set the textviews to invisible and the seekbar max to 100. It works fine for the …