I have this code but the problem is that this continually showing toast of each string line when I pressed my desired button. Like this: Clicked the button once: Toast shows continually: A B C What I …
Tag: android
How to display an image from the Gallery in an ImageView?
I created a button that lets the user choose between “Take picture with camera” and “Select picture from gallery”. When the picture is taken/chosen, I then display it in an ImageView of the next activity which I do by passing the URI of the file created to store the taken/selected pict…
How to forward click event to Launcher app?
I have a widget placed programatically on the Home screen, and I made it possible for the user to drag it to the place he wishes. I have added an OnTouchListener to the view to get motion events (so …
Android equalizer not working with AudioTrack
I am using android equalizer API to create a high pass filter. But even if I set every band to -1500 it does not seems to work. The audio is playing well but no eq effects. Here is my code. I am getting the audio session-id by at.getAudioSessionId() where at is an already initialized AudioTrack. As I said Aud…
Source code does not match the bytecode for Android’s View.java
I am attempting to debug my Android app. When the debugger gets to the View.java file, I receive the message, “Source code does not match the bytecode”. I can see that the debugger is in the wrong part of the file. Does anyone know how to fix this? I am debugging on an Android 10 (API 29) device. …
Press back button on main activity opens other activity
In my project i move from main activity to activity A and from activity A to activity B. From activity B using home menu on toolbar i jump back to main activity. Now when i press back button application should exit but it opens the activity A again. Answer You should make use of the launch flags to manage you…
Android ScrollView jumps up after changing child element visibility
I have a ScrollView that contains elements with visibility set to View.GONE by default. The problem is that whenever this visibility changes from View.GONE to View.VISIBLE, scroll jumps up as it is shown on second picture: https://i.imgur.com/WmRc4M2.png The red box represents current scroll position, blue re…
How do I properly capture the logcat using a process and filtering on PID?
It seems straightforward enough. I’m using Runtime.getRuntime().exec(commandString); I’ve tried I’ve tried it without the -v raw and have also tried (and need to) use multiple PIDs using |. Nothing seems to work. I have a new BufferedReader(new InputStreamReader(p.getInputStream())); that ge…
Get incoming call number programmatically on android 10
Looking at previous solutions for this problem are now depreciated as of api 29(Android 10). Has anyone been able to get the incoming phone number on for api 29. Apparently now to do this you need to use CallScreeningService Answer Yes, implement the class and add the necessary permission below in the manifes…
Android studio can’t find ArrayList class
First of all I’ve been using Android studio for quite years but this has never happened before. It seems like android studio’s inner ArrayList class has vanished out of a sudden. I can’t use ArrayList. It always says Can’t find symbol ArrayList I’ve cleaned rebuild and even inval…