Android Studio Code Snippet I have an android device that has it’s maximum width and height specified in dp units. Max Width – 1079 dp Max Height – 399 dp I want to create a LinearLayout that has to be present vertically and horizontally centered with its height to be in wrap_content length and width to occupy 50vw units. I
Tag: android-layout
Webview from Android Studio does show a navigation menu and background logo
Context I’m trying to implement a webview for my website, using Android Studio and Java. Here is the code for MainActivity.java AndroidManifest.xml activity_main.xml Problem My webview does not show the navigation menu (dots) and the banner. The following two screenshots show my webview (left) and the website itself (right). The solution from this post did not help. Namely, I tried
How to implement “favourite” button feature (like favourite recipe/food) and display on another list in another fragment
I want to have a feature that when the user clicked the button on a certain row, it will add the row to another list which is called favorite list. Currently i have created database that also include favourite status. I already tried to start with creating a button that when its clicked it will change the fav status. Im
ConstraintLayout braking after displaying Android Studio
I am currently working on an android app, and I’m having an issue with displaying XML layout In Android Studio, everything looks fine, but in the VM it doesn’t look too good. This is how it looks in Android Studio: And here is how it looks like when it’s displayed in VM: I should probably mention that it is supposed
Hide TextView when CollapsingToolbarLayout is Collapsed, and show it when expanded
I am working on an app using a CollapsingToolbarLayout, with an ImageView inside it. I wanted to add a gradient on top of it to look nicer and to be able to read the CollapsingToolBar title better, so I made a little hack and added a Relative Layout with a textview inside it, then I added a background to that
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
AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant)
iOS developer here thrown to the wolves of an Android project. I am getting a few error codes that all say something similar to ThemeUtils: View class androidx.appcompat.widget.AppCompatTextView is an AppCompat widget that can only be used with a Theme.AppCompat theme (or descendant). as soon as the following code snippet runs: My inflater is instantiated as follows: SqueaksApplication.getApplicationInstance() just returns
Creating dialogue box pop up – Android studio
Relatively new to the whole javascript scene -trying to create my first app! So far I have managed to create the base layout, link button to next .xml, etc. however I’d really like a button that when clicked, opens a pop-up with some information on (a few lines describing the app’s purpose). Unfortunately, all tutorials, although helpful, don’t explain where
Adding a linear layout in XML dynamically to another linear layout
Basically I created a separate XML containing a linear layout which contains a image and a textview, and I need this linear layout inside of another linear layout, where I need to add my first linear layout dynamically to the second linear layout. First linear layout, a separate XML file : Second linear layout, separate XML: Android Studio code: This
How do I only allow the user to enter sensible height and weight values in Edit Text? Java
I’m making a super simple BMI calculator app using Java in android studio but I’d like to make it so that the user is only able to enter sensible values for their height and weight. I was thinking something around 50cm-220cm for height and 3kg-150kg for weight. As it stands, they can enter any number and come out with absurdly