All Questions
Tagged with android-appcompat java
214 questions
0
votes
0
answers
64
views
Main Activity doesn't extend AppCompatActivity
once I open android studio and I found an error in main activty in some functions like "startActivity(intent) it gives an error: (cannot resolve method 'startActivity' in 'mainActivity')" ...
0
votes
0
answers
31
views
AppCompat Views don't scale drawable correctly
I'm building an android app on java using AppCompat for UI. My app has to show names and icons of apps installed on a phone in a grid, for this I use a RecycleView (VerticalGridView).
I get icons ...
5
votes
1
answer
4k
views
Execution failed for task ':app:mergeExtDexDebug' As A Result of A Null Pointer Exception
I’m making an app that displays PDF's in android studio it loads the files and then displays them via an external library I haven't fully implemented the display feature as of yet mainly due to the ...
0
votes
0
answers
85
views
Android Studio error <item> inner element must either be a resource reference or empty
I saw so many same questions out there about this issue, but I really have no idea how to fix this autogenerated file. Any inputs would be truly appreciated.
When I delete the following code, in \...
1
vote
0
answers
303
views
Getting error java.lang.NoSuchMethodException: android.graphics.FontFamily.<init>
I am getting this error ever since upgrading the SDK version to 30:
E/TypefaceCompatApi26Impl: Unable to collect necessary methods for class java.lang.NoSuchMethodException java.lang....
1
vote
1
answer
688
views
Error after updating androidx.appcompat:appcompat
Error after updating androidx.appcompat:appcompat to version 1.5.0
Error:
Duplicate class androidx.lifecycle.ViewModelLazy found in modules lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:...
0
votes
1
answer
555
views
How to Remove special Characters from Java String at the end and at the beginning
lets say i have a string like
String examplestring = "%,.&/)"hello, mynameis, Fatih-Mehmet!And yours?insidedot.2874d3"(.)§("
And i would want to extract the core part of
...
2
votes
1
answer
2k
views
Android inflate layout crashes after adding fragment container view
currently I have a custom drawer activity that extends AppCompatActivity, which looks like the following:
public class DrawerActivity extends AppCompatActivity implements NavigationView....
0
votes
0
answers
79
views
Using support library in Android Java
I want to set up Toolbar but when I import support libary, I have a problem:
"Failed to resolve: com.android.support:appcompat-v7:32.0.0"
-4
votes
1
answer
613
views
How do I add a library (androidx.appcompat:appcompat:1.4.1) in Android Studio [closed]
I created a Basic activity in Android Studio and tried to run it on my Physical Device but while building the application is show an error under The minCompileSdk (31) specified in a:
The ...
1
vote
0
answers
617
views
MenuPresenter can only be accessed from within the same library group prefix (referenced groupId=androidx.appcompat with prefix androidx from groupId
I'm currently updating the codebase for a project that I found on Github that uses a handy search feature.
I've updated most of the codebase however I keep getting issues similar to the post title, I ...
0
votes
1
answer
36
views
My application quits after adding AppCompatActivity
I added
compile 'com.android.support:appcompat-v7:+'
I then add this in my MainActivity
import android.support.v7.app.AppCompatActivity;
Then I changed Extends Acitivity to AppCompatActivity
And my ...
0
votes
0
answers
370
views
Changing color of the Status bar with colorPrimaryDark is not working
SO, I'm trying to change the color of the status bar, but for some reason, it's not working. My API level is 29. None of the colors from the color.xml file work. Here's my code:
styles.xml:
<...
-1
votes
1
answer
81
views
Appcompat activity along with androidx gradle version issue in android studio
Appcompat version used in app is v7, androidx is used for integration with gradle.properties for firebase connection
Please help
0
votes
2
answers
577
views
how to set "app:backgroundTint" via style?
I want to replace:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:backgroundTint = &...
3
votes
1
answer
8k
views
Android: package android.support.v7.app.AlertDialog does not exist
So im trying to implement a barcode scanner functionallity
And i have this piece of code
private void showMessageOKCancel(String message, DialogInterface.OnClickListener okListener) {
new ...
0
votes
0
answers
1k
views
Crash: You need to use a Theme.AppCompat theme
My app crashes below Android 6. Here is my Error log:
05-19 12:38:13.682 24304-24304/com.example.find E/AndroidRuntime: FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ...
0
votes
1
answer
238
views
how to fix LayoutInflater error in java android?
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageSwitcher;
import android.widget.ImageView;
...
0
votes
1
answer
229
views
Custom Edittext Hiding pin bar after text is inputted
I'm a beginner android developer and trying to create a Custom Pin Edittext using the following code and i want to set the color of the pin to transparent if filled,unfortunately there is no ...
0
votes
0
answers
42
views
Last three scores of the user not displaying within android studio
Despite inputting my code below the only output to the user seems to be 0 in all three cases. Unsure on why this would be the case. Such as the image below seems to output the score to the user ...
1
vote
1
answer
306
views
How to resolve: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity?
There are some other articles with same subject, but my case is different.
I am using a BroadcastReciever in an AlarmManager application. Upon Alarm fire, I am trying to display an AlertDialog with ...
1
vote
0
answers
193
views
How can I use MediaSessionManager in Android API 16?
import android.media.session.MediaSessionManager;
private MediaSessionManager mediaSessionManager;
mediaSessionManager = (MediaSessionManager) getSystemService(Context.MEDIA_SESSION_SERVICE);
It ...
1
vote
2
answers
172
views
How to have a global click Listener for multiple buttons in the same layout?
Suppose if we are having 50 Buttons in a layout instead of creating click listeners for each buttons.
Eg:
button1.setOnClickListener(this);
button2.setOnClickListener(this);
If we have 50 Buttons ...
0
votes
1
answer
319
views
Error while building project : Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
I'm trying to keep my current SDK version as 27 and don't want to upgrade to AndroidX. What can be the solution for this error?
Error highlihted
0
votes
2
answers
655
views
AppCompatActivity has changed my AlertDialog design
I have change my activity to appCompat Activity.
Also i changed AlertDialog to Android.Support.V7.App.AlertDialog.
But i have lost my previous alertdialog design.
This is how it was look like.
And ...
2
votes
1
answer
3k
views
setupWithViewPager(android.support.v4.view.ViewPager) in TabLayout cannot br applied to (androidx.viewpager..widget.ViewPager)
how to fix this error
setupWithViewPager(android.support.v4.view.ViewPager) in TabLayout
cannot br applied to (androidx.viewpager..widget.ViewPager)
here is my class
package org.apoce.app;
...
2
votes
1
answer
2k
views
FragmentManager can't resolve in androidx
FragmentManager and beginTransaction cannot resolve in androidx
FragmentManager fM = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fM.beginTransaction();
2
votes
1
answer
1k
views
Inflate exception occurs 'androidx.appcompat:appcompat:1.1.0'
I am trying to upgrade my gradle. When i updated the appcompat from 1.0.2 to 1.1.0, my webview didnt work anymore on certain phones. (api 21 and 22).
Is there a smart way to upgrade to 1.1.0 and still ...
8
votes
5
answers
51k
views
Cannot resolve symbol 'ActivityCompat' and 'content'
I am new to android and was learning how to implement Location Based Services, and i encounter the following errors -
Cannot resolve symbol 'ActivityCompat'
in line 'import android.support.v4....
0
votes
1
answer
95
views
"ActionBarSherlock" error after removing ActionBarSharelock from gradle implementation
Just recently I posted a question as I had a link issue. Then there I was told by a person that you cannot use ActionBarSharelock and AppCompat at the same time. So they advised me to remove the ...
1
vote
1
answer
146
views
failed linking references resource and duplicate value after update Android Studio
I've been researching this issue for the past 5 days. And there were enough solutions, but no one could help me. Please tell me a solution to this problem.
Some Screenshots and Code Here Below:
...
0
votes
3
answers
3k
views
getSupportActionBar() in AppCompatActivity cannot be applied to androidx.appcompat.widget.Toolbar
I am getting an error while developing the toolbar I have searched solution on the internet and dint gets any solution working as I am new to android development.
I have tried to change the androidx....
0
votes
1
answer
235
views
AdMob Overlaying Recyclerview List Item
I have Admob Banner adds in my Recycler listview, but the ad is overlaying the list item. I have been through the stack looking for a way to fix this, the closest I have come is Embedding ads within ...
4
votes
5
answers
7k
views
Cannot resolve symbol, android studio
It's my first time working with android studio and I get error
"Cannot resolve symbol AppCompatActivity", and other symbol errors.
How can I resolve it? I've tried adding things to gradle but ...
0
votes
1
answer
2k
views
How to fix error package android.support.v7 does not exist?
I've been trying to fix the error message for several hours already "package android.support.v7 does not exist"
Came across every topic about this here, but none of them helped me.
I've tried to ...
5
votes
3
answers
3k
views
Android ClassNotFoundException with appcompat-v7:28.0.0
I'm developing an Android application and I try to use the toolbar to add some functionality on it; that's why I'm using appcompat-v7 module.
I have followed this tutorial (Sorry because it's in ...
1
vote
7
answers
4k
views
How to fix "Cannot resolve symbol 'app' " in android studio?
Android studio is showing errors on every line that is related to support library. And on rebuilding the project it says:
Android resource linking failed.
I've tried following:
clean/rebuild
...
2
votes
3
answers
3k
views
Can't import "GestureDetectorCompat" class
I am trying to import GestureDetectorCompat.class into Android Studio but doesn't work.
I tried adding import androidx.core.view.GestureDetectorCompat; and import android.support.v4.view....
7
votes
3
answers
7k
views
What's the difference between android.widget.Toolbar and android.support.v7.widget.Toolbar?
Could someone please explain to me the difference between them and why aren't they interchangeable?
Importing android.widget.Toolbar will cause compilation error whereas importing android.support.v7....
5
votes
1
answer
815
views
How does AppCompat inflate layouts that do not explicitly use AppCompat widgets?
It occurred to me while using AppCompat, that I had been using things like Button instead of android.support.v7.widget.AppCompatButton within my layout XML files. I did a test, via view.getClass()....
2
votes
1
answer
1k
views
PreferenceFragmentCompat won't change color when change theme and recreate activity
I'm using PreferenceFragmentCompat for preferences and when I change theme preference using ListPreference to a dark theme and recreate activity text stays dark and becomes not visible. If I reopen ...
3
votes
1
answer
5k
views
Unable to instantiate appComponentFactory when using Google Maps Android Marker Clustering Utility
When I try to run my app and load te map from Google to show nearby places, it will show the map but not the places. I have been searching on Stackoverflow but haven't found a solution that works...
...
0
votes
0
answers
46
views
Android appcompat-v7 libraries not recognized
I moved my project to a new computer, with freshly installed Java and Android Studio, and it started acting weirdly. First, I was required to change "compile" with "implementation" in my gradle file. ...
0
votes
0
answers
45
views
How to remove extra white background in buttons after using AppCompat Theme?
TL;DR;
How to remove the below unwanted white area?
I tried to change my theme which extends "Theme.AppCompat.Light.NoActionBar" and added my own customization.
After using the theme, all "pop-up" ...
-1
votes
1
answer
385
views
Unable to identify value of EditText variable (appcompat error) and convert edit text successfully
I am currently trying to figure out how I can see the value of an edit text variable. In my code I am trying to take a user entered number and apply mathematics to it to produce a tip calculator. Only ...
0
votes
1
answer
40
views
Why The up button has been added in all activities while i enabled it only in one activity?
I followed the Google documentation for adding the up button , here is the link https://developer.android.com/training/implementing-navigation/ancestral?utm_source=udacity&utm_medium=course&...
0
votes
2
answers
854
views
I cant see textview and other elements layout android studio in activity_main.xml
This error is displayed:
Render problem - Failed to load AppCompat ActionBar with unknown error.
xml (text):
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint....
-1
votes
1
answer
1k
views
Issue with You need to use a Theme.AppCompat theme (or descendant) with this activity Theme.AppCompat theme (or descendant) with this activity"
I am suddenly getting this issue. I have gone through a number of the posts on this site and others. Here are a few of the links I have visited in my attempts to understand the cause of this problem; ...
5
votes
1
answer
2k
views
Maven doesn't download jars from google repository
I'm using eclispe with adt + maven to devellop an android app (what google has successfully made difficult enough)
But eclipse doens't recognieze google's support library for android, I added it to ...
7
votes
1
answer
8k
views
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$drawable;
After some time away from a project I popped it open and tried to run it again, and it fails with the following error. The same error seems to be occurring in multiple projects.
Error:
03-12 15:...