android-inflate

Android InflateException Error in fragment layout with SupportMapFragment (recreated fragment)

烈酒焚心 提交于 2020-01-06 19:58:08
问题 All more or less works. But if the LocationFragment is recreated, the application falls. Manifest <?xml version="1.0" encoding="utf-8"?> <manifest package="XX.XX.XXXXXXXX" xmlns:android="http://schemas.android.com/apk/res/android"> <uses-permission android:name="android.permission.GET_ACCOUNTS"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <uses-permission android:name="android.permission.CAMERA"/>

How to inflate a ListView to a View

末鹿安然 提交于 2020-01-06 03:23:49
问题 I'm new here so i will try to explain my problems as good as i can. I am trying to inflate a ListView into a View in my main activity. My main activity has some buttons and texts on the top of the Activity and there is enough space left for the listView. The listview is consisted of categories, represented as an imageView and a textview. The problem im facing is that when i inflate the category_list_activity, the activity i created for the category list, two things happen: The ListView takes

IllegalStateException of toast View on Android P preview

限于喜欢 提交于 2020-01-01 12:11:31
问题 While trying to release my app for production, the pre-launch report notified me of an error on Pixel 2 Android P Preview device. The error is related to a custom toast message I have, saying that a View "has already been added to the window manager": java.lang.IllegalStateException: View android.support.constraint.ConstraintLayout{efbeb21 V.E...... ......ID 0,0-788,1124 #7f0900db app:id/toast_correct_container} has already been added to the window manager. at android.view.WindowManagerGlobal

error while inflating XML in Google maps fragment

被刻印的时光 ゝ 提交于 2020-01-01 11:42:21
问题 trying to display Google map using a fragment. Used the following page as a tutorial. I am getting the exception "Error Inflating class fragment ". 1) Imported the jar google-play-services.jar 2) downloaded and configured the google play services SDK. 3) got the latest v2 API Key. 4) Added permission com.google.android.providers.gsf.permission.READ_GSERVICES in the manifest. 5) using mindsdk = 8 and target = 16. For a reference, Androidmanifest.xml : <?xml version="1.0" encoding="utf-8"?>

Programmatically Inflate View with pre-defined measures

你离开我真会死。 提交于 2019-12-31 04:11:30
问题 I have a layout resource like this and a I want to inflate it with the layout width and height: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="75px" android:layout_height="25px"> <TextView android:id="@+id/drawable_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:text="Name" /> <TextView

Programmatically Inflate View with pre-defined measures

笑着哭i 提交于 2019-12-31 04:11:19
问题 I have a layout resource like this and a I want to inflate it with the layout width and height: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="75px" android:layout_height="25px"> <TextView android:id="@+id/drawable_name" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:text="Name" /> <TextView

Error inflating class Button in Android

柔情痞子 提交于 2019-12-30 07:22:24
问题 I have an application with min sdk 16 up to 23. I want to use Material design as much as possible. It also has to be fullscreen app. AppCompat support library is included. Now I have Logon activity with some buttons: <Button android:id="@+id/act_logon_btn_logon" style="@style/ButtonDefault" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/act_logon_logon" /> Styles are as follows (values/styles.xml): <style name="Theme.AppCompat.Light.NoActionBar

Error inflating class Button in Android

蹲街弑〆低调 提交于 2019-12-30 07:22:08
问题 I have an application with min sdk 16 up to 23. I want to use Material design as much as possible. It also has to be fullscreen app. AppCompat support library is included. Now I have Logon activity with some buttons: <Button android:id="@+id/act_logon_btn_logon" style="@style/ButtonDefault" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/act_logon_logon" /> Styles are as follows (values/styles.xml): <style name="Theme.AppCompat.Light.NoActionBar

What does it mean to inflate a view from an xml file?

北慕城南 提交于 2019-12-28 01:38:32
问题 I am new to android development and keep coming across references to Inflating views from a layout xml file. I googled and searched the development guide but still wasn't able to pick up a sense for what it means. If someone could provide a very simple example, it'd be much appreciated. 回答1: When you write an XML layout, it will be inflated by the Android OS which basically means that it will be rendered by creating view object in memory. Let's call that implicit inflation (the OS will

Error trying to add a map: android.view.InflateException: Binary XML file line #9: Error inflating class com.google.android.maps.MapView

好久不见. 提交于 2019-12-25 04:57:10
问题 I create the following class who extends MapActivity. The error is in this class here in the line View view = infalInflater.inflate(R.layout.car_map_view, null); public class ShowCarMapChild extends MapActivity { private MapView mapView; private Car car; private String tag; @Override protected void onCreate(Bundle icicle) { // TODO Auto-generated method stub super.onCreate(icicle); setContentView(R.layout.car_map_view); } public void setCar(Car car){ this.car = car; } public void setTag