Can I make a Fragment to display different content depending on what was selected in the previous screen. For example: I create Fragment with ImageView and TextView. In MainActivity I click Button1 and the Fragment opens and shows some content, and if I click Button2 the same Fragment opens but different content is displayed. Is it possible to do this?
Tag: android-studio
added library to my custom library could not be found
I built an android library and added a library to it for a custom rating bar. used it in my library and everything was ok until i added my library to an empty app for test. then I get this error while trying to build the app. … Execution failed for task ‘:app:checkDebugAarMetadata’. Could not resolve all files for configuration
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException after updating to Android Studio 4.2
Google just release Android Studio 4.2 stable. I updated my AS from 4.1 to 4.2. Now I am getting this error. It’s showing error in data binding. Answer Android Studio 4.2.0 and more now comes with Java 11.0.8 shipped and will use it by default which cases this error in deprecated libraries. The solution is simple, you need to change
Finishing an Activity with transition shows the previous Activity from the activity stack first and then transitions to the new Activity
I have 2 Activities in my Android application – Activity A and Activity B. When the user presses a button on Activity A, he is navigated to Activity B. I want Activity A to close after going to the next activity and is completely removed from the activity stack. I tried adding intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); , but this not work
Java problem, run time error, maybe problem occurs on numbers activity.xml file, tried to configure problem but still app is not working [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question MainActivity.java activity_main.xml numberActivity.java activity_numbers.xml Debugging error (in Logcat)= numbersactivity.java file numbersactivity.xml file mainactivity.java
How to only let Edit Text accept Letters which are in Textview
I have an edit text however I only want letters which are in another Text view to be typeable. For example if the Text view say Hello Only H,E,L and O should be Typeable. Answer Using this code you can get it to only accept your String
How to fix: found 15 USB devices not recognized as Android devices?
I am getting this message ‘No Devices’, when I click troubleshoot device connections I’m getting this error: found 15 USB devices not recognized as Android devices When I click next in troubleshooting page I get another error: No Android devices detected. I was able to use my device on my other computer, now using another, so I mean developer mode
Buttons Disappear With ScrollView on Android Studio
without ScrollView, my buttons look fine but after I use it, the buttons disappear, I tried a lot at solution but the thing appear is just <TextView>. How can I make them appear as preferred? activity_main.xml MainActivity.java is as default. It works like this: Answer The problem is that your button widths are zero. Change the width and you will
AM Emulator: Library vulkan-1.dll: failed for handleCPUAcceleration [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question The Emulator shows following error when you run it in Android Studio on
When you change attributes in an xml file, which constructor of custom view is called?
I am creating my own custom view. Here is the code for MyCustomView.java And my main_layout.xml file: My question is: If I change the attributes of the custom view in the .xml file, will the 2nd or 3rd constructor of MyCustomView.java file be called? Answer As described by @Zain answer the two-argument constructor is called when the layout is inflated