appcompatactivity

Runtime Error while using AppCompatActivity instead of Actionbar

送分小仙女□ 提交于 2020-01-05 01:38:07
问题 I am using the AppCompatActivity library to make support all the devices. After upadting the android-support-v7-appcompat library i am facing issue. But i am facing an error during run-time. I am using eclipse studio to code for android project. Any help will be appreciated. Below is my error ,and i am getting no idea where i am going wrong. ** ERROR ** E/AndroidRuntime(6899): FATAL EXCEPTION: main E/AndroidRuntime(6899): java.lang.RuntimeException: Unable to start activity ComponentInfo{com

How can an activity use a Toolbar without extending AppCompatActivity

纵然是瞬间 提交于 2020-01-03 20:12:53
问题 I have an activity HomeView which already extends another activity and it cannot extend AppCompatActivity . But HomeView needs to have a Toolbar. The Android documentation says that any activity which needs to have a Toolbar must extend AppCompatActivity . How can I get around this limitation? 回答1: You need to implement AppCompatCallback and use AppCompatDelegate . Here's an excellent article about how to use it: https://medium.com/google-developer-experts/how-to-add-toolbar-to-an-activity

How can an activity use a Toolbar without extending AppCompatActivity

你。 提交于 2020-01-03 20:12:07
问题 I have an activity HomeView which already extends another activity and it cannot extend AppCompatActivity . But HomeView needs to have a Toolbar. The Android documentation says that any activity which needs to have a Toolbar must extend AppCompatActivity . How can I get around this limitation? 回答1: You need to implement AppCompatCallback and use AppCompatDelegate . Here's an excellent article about how to use it: https://medium.com/google-developer-experts/how-to-add-toolbar-to-an-activity

AppCompatActivity is not working properly

拟墨画扇 提交于 2019-12-24 09:34:56
问题 I am developing an app which uses AppCompatActivity. I have been struggling since so many days solving this error but no luck and no reply for such an answer on StackOverflow. The gradle is built successfully without any error. But when the app is installed in the device, I get a force close error. I am attaching my Android Monitor(logcat) content here. Please help me with this. java.lang.NoSuchMethodError: android.support.v4.view.ViewCompat.setOnApplyWindowInsetsListener(Landroid/view/View

Failed to resolve attribute at index 13 at android.content.res.TypedArray.getDrawable()

旧城冷巷雨未停 提交于 2019-12-23 16:27:31
问题 My android app runs on a sdk 23 emulator just perfectly, but when I tried to run it on a tablet with sdk version 21, I got this exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.detactapp.detactapp/com.example.detactapp.detactapp.Home}: java.lang.RuntimeException: Failed to resolve attribute at index 13 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java

BottomNavigationView inflate error after migrating to androidx

删除回忆录丶 提交于 2019-12-22 05:10:46
问题 When I try to launch my app, my Mainactivity throws this error in the oncreate() method at "setContentView(R.layout.activity_main);" : java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sanchez.worldgramproject/com.example.sanchez.worldgramproject.Fragments.MainActivity}: android.view.InflateException: Binary XML file line #16: Binary XML file line #16: Error inflating class android.support.design.widget.BottomNavigationView This Error appeared after migrating to

Why does the XML onClick attribute set an OnClickListener TWICE on AppCompatButtons

ⅰ亾dé卋堺 提交于 2019-12-20 06:25:26
问题 When Android inflates a Button with an onClick XML attribute, it internally sets a DeclaredOnClickListener on that Button which then uses reflection to trigger the actually onClick method in our code. case R.styleable.View_onClick: [...] final String handlerName = a.getString(attr); if (handlerName != null) { setOnClickListener(new DeclaredOnClickListener(this, handlerName)); } break; I noticed that for AppCompatButton s (i.e. normal Buttons in an AppCompatActivity ) the same process gets

How to fix: “You need to use a Theme.AppCompat theme (or descendant) with this activity”

送分小仙女□ 提交于 2019-12-17 09:35:23
问题 I am having trouble running my Android app in a fullscreen mode per instructions of a video. When it tries to run, the app crashes with the error. "You need to use a Theme.AppCompat theme (or descendant) with this activity Manifest File <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.djsg38.hikerswatch"> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android

java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener

∥☆過路亽.° 提交于 2019-12-17 07:39:26
问题 I upgraded my android studio to 2.1.3. And now I am getting following error java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of 'android.support.v4.view.ViewCompatLollipop' appears in /data/data/com.restroshop.restroowner/files/instant-run/dex/slice-internal_impl-24.2.0

why do android insists that I already have action bar?

浪子不回头ぞ 提交于 2019-12-14 04:23:10
问题 Following the tutorial here: http://www.android4devs.com/2015/01/how-to-make-material-design-sliding-tabs.html# trying to perform material design sliding tabs I did everything as instructed. However, when I run the app it gave me the following message: java.lang.IllegalStateException: This Activity already has an action bar supplied by the window decor. Do not request Window.FEATURE_ACTION_BAR and set windowActionBar to false in your theme to use a Toolbar instead. I tried to resolve this and