I am new to Java programing language.
In my app I have two side menus (left menu and right menu). And I have a WebView in my app which loads my Website home page.
But the issue is that I am unable to add another webwiew to my left and right menus.
Whenever I try to update or add to my menu.XML I always get the error
unfortunate App has stopped
My AiDE does not show any error.
How can I add more webwiews to different XML files with just on MainActivity.java file?
Related
I have a webview with the following problem: on android and desktop it works perfectly on the first page, but when I click the button to go to the second page, the height of the page does not show entirely. Only in android, the scroll and buttons are not responding, desktop is fine. It's an android project downloaded from another github user...
This is the first page working great
This is the second page issue with scroll and buttons
This is the XML layout code file:
xml code part one
xml code part two
and here are the more important lines about the webview settings located in MainActivity.java file
mainactivty.java webview settings
NOTE: Normally the website is responsive and working perfectly, whatever android, ios, etc... device, its totally responsive and works fine into a web browser in mobile device, tested physically with real device (no android emulator)
The issue is only with the second page...
remove the web view from the NestedScrollView and make it match_parent
I am building AOSP for a custom device which is running only one app. The user of the device should be able to connect to wifi, but not to be able to make any other settings.
Unfortunately the settings app of Android 10 has this search button in the Actionbar (see screenshot). From here the user could jump to any other menu in the settings.
I want to remove the search button but i cant find the place where it is inserted. It looks like that it is dynamically created by PreferenceScreen.
Anyone knows where to find it.
Delete the searchbar from packages/apps/Settings/res/layout/settings_homepage_container.xml
<include layout="#layout/search_bar"/>
I am sorry, this is a noob question but I can't help feel isolated.
I was following an online course on Android and when they displayed the IDE for the first time it looked like this:
Referance Image
On the contrary, my screenshot looks like this:
My screenshot
How do I make my Android studio display that phone and thereby preview my code?
You are on the blueprint view. Click on the layout button that is located on the left of the blue button in the center and under main activity tab
There can be the reason that either IDE still processing the layout to display or there can be error in the XML code. If no error still you can refresh by pulling the error bar from the bottom and click refresh.
I am very new to android programming, migrating over from iOS and I am having a hard time.
So, I have set up a new application in Eclipse IDE with a fixed tab and swipe navigation. So it appears to have created a ActionBar. However, I need to change the content of each page rather than it just telling me which tab I clicked.
I have been searching for this for about, 30-45 mins now, and I cannot find anything which makes any sense!
How can I attach a new XML file to a view?
I think the code you are looking for is:
setContentView(R.layout.your_xml_file)
Make sure your xml file is in your res/layout folder in your project
As for your button listener, check this answer.
Okay. What I have so far is an Android app with a Google map on which I've placed a bunch of icons that, when clicked on, create a popup with some text on it. Is there any way to place a button on that popup? If this is not possible, is there some way to make a button appear when an icon on Google Maps is selected?
In case you're wondering, the code I'm using now looks like this.
itemizedOverlay.addOverlay(new OverlayItem(point, title, text));
//actually a whole bunch of OverlayItems, each with their own location and text
//but this is the general shape of it.
mapOverlays.add(itemizedOverlay);
Edit:
There are different kinds of popups used with different versions (check yourself in the emulator versions) of the GoogleMaps app. The first popup simple displays the title of the location (Android 2.3.3).
The second popup shows the title and arrow indicator. (Android 4.0.3)
Interesting enough: I noticed that both popups are clickable and start another activity that shows details about the location.
The mapviewballon project https://github.com/jgilfelt/android-mapviewballoons/ allows you to use your own custom layout for these popup.
I did not test with buttons on it but I do not see why I would not work.
The example projects shows the following types of popup balloons.
Here is another project that creates a custom popup balloon. The project can be downloaded at the end of the article.