appcompatactivity

Xamarin Forms Android AppCompatActivity Toolbar background color is not changing

左心房为你撑大大i 提交于 2019-12-13 20:43:31
问题 In my Xamarin Forms Android Project I need to change the ToolBar Title color and background color I have tried with many workarounds suggested in Google but unfortunately I am unable to find the correct solution to me What I Need is What I am getting Now is by using below codes MainActivity.cs [Activity(Label = "Sample.Droid", Icon = "@mipmap/icon_launcher", Theme = "@style/MyTheme")] public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity { protected

Getting 'The method setSupportActionBar(Toolbar) in the type AppCompatActivity is not applicable for the arguments (Toolbar)' in my AppCompatActivity

我只是一个虾纸丫 提交于 2019-12-11 12:16:40
问题 I'm upgrading the UI of a game that I built some time ago and am heading toward Google's Material Design. As part of the code upgrade, I installed the backwards compatibility support library, android-support-v7-appcompat, into my Eclipse project and extended the main activity to AppCompatActivity, like so: public class FivetoGo extends AppCompatActivity { @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.main); Toolbar mToolbar = (Toolbar)

Updated appcompat-v7 to the newest version, get NoClassDefFound for AppCompatDelegateImplV23

谁都会走 提交于 2019-12-11 02:42:48
问题 I read on the CommonsWare blog that it's a smart idea to update appcompat-v7 to the newest version before the roll out of Android 6.0 so I just went ahead and tried to do that with my project in Eclipse. After updating the library (I simply removed the previous version and added the new one with resources), my (previously ActionBarActivity) AppCompatActivity does not start (the app crashes). This is the LogCat content: 08-20 02:55:58.417: I/art(28031): Rejecting re-init on previously-failed

AppCompatActivity cannot be resolved to a type

眉间皱痕 提交于 2019-12-08 13:02:41
问题 I am trying to add Theme to my project. It requires appcompat v7. I added the support library according to the steps mentioned in the Android developer website. After searching a lot I came to know that support library v4 will conflict with support library v7. So I removed the android library v4 from my project. Because of that now I got the NotificationCompa t error( import android.support.v4.app.NotificationCompat; import android.support.v4.app.NotificationCompat.Builder; ). What I have to

Cannot resolve findViewByID in AppCompatActivity

心不动则不痛 提交于 2019-12-08 03:08:27
问题 I'm following this tutorial: Android Material Design Using Tabs Infos: Android API Level 21 Dependecies are added to graddle file compile 'com.android.support:appcompat-v7:23.0.1' and compile 'com.android.support:design:23.0.1' } The method "findViewById" cannot be resolved. I tried to follow this answer Cannot resolve method 'findViewById(int)' in Fragment, but this AppCompatActivity use OnCreateBundle instead OnCreateView, then i can't get the View object... What is wrong with this code ? I

Cannot resolve findViewByID in AppCompatActivity

浪尽此生 提交于 2019-12-06 09:52:50
I'm following this tutorial: Android Material Design Using Tabs Infos: Android API Level 21 Dependecies are added to graddle file compile 'com.android.support:appcompat-v7:23.0.1' and compile 'com.android.support:design:23.0.1' } The method "findViewById" cannot be resolved. I tried to follow this answer Cannot resolve method 'findViewById(int)' in Fragment , but this AppCompatActivity use OnCreateBundle instead OnCreateView, then i can't get the View object... What is wrong with this code ? I'm missing some import? package info.androidhive.materialtabs.activity; import android.os.Bundle;

BottomNavigationView inflate error after migrating to androidx

孤人 提交于 2019-12-05 08:29:43
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 androidx , after further inspection I noticed that the import statements in the Bottomnavigationview

How can I fix this error: You need to use a Theme.AppCompat theme (or descendant) with this activity

断了今生、忘了曾经 提交于 2019-12-04 18:09:54
问题 I searched all internet web sites to fix this error, but I couldn't. I just want to create AlertDialog with two button Yes and No. This is my code: import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class DialogActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate

Out of Memory : android.support.v7.app.AppCompatActivity.onCreate

末鹿安然 提交于 2019-12-04 07:28:12
问题 we recently switched to using AppCompatActivity instead of FragmentActivity and now some devices are randomly crashing with the following error. No idea why this is happening. Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 16008012 byte allocation with 4277152 free bytes and 4MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java) at android.graphics.BitmapFactory.nativeDecodeAsset(BitmapFactory.java) at android.graphics.BitmapFactory.decodeStream

How can I fix this error: You need to use a Theme.AppCompat theme (or descendant) with this activity

天涯浪子 提交于 2019-12-03 11:39:19
I searched all internet web sites to fix this error, but I couldn't. I just want to create AlertDialog with two button Yes and No. This is my code: import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class DialogActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_dialog); Button btnDialog= (Button) findViewById(R