Skip to content

Tag: android

TextView cannot be cast to EditText

First time posting a question to this site so I might make some mistakes! I’m new to programming and getting the following error when running an application in Android Studio: The code that’s causing this issue is I’ve tried to delete the R.java files and clean the project but it didn’…

Pdf Renderer API Android From URL

I am looking into the PDF renderer API native to Google Android development. I see the following code example in the documentation: I think this example uses from File Object. How I can get this API to work with a URL from a webserver, such as a document from a website? How can I load a PDF natively in an

How to disable button while AlphaAnimation running

I want to disable click on button when the animation running. the code is below: So i want to cant click the button until animation done. Answer I normally accomplish something like this is using an AnimationListener. It allows you to run code at various stages of the animation. This code is untested, but the…

How to assert inside a RecyclerView in Espresso?

I am using espresso-contrib to perform actions on a RecyclerView, and it works as it should, ex: and I need to perform assertions on it. Something like this: but, because RecyclerViewActions is, of course, expecting an action, it says wrong 2nd argument type. There’s no RecyclerViewAssertions on espress…

Shared Preferences on a Null Object Reference Android

I am new to android developing maybe its a silly question but please help me. I am getting this error while trying to save an int value. Caused by: java.lang.NullPointerException: Attempt to invoke virtual method ‘android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.S…

Rotate image continuously

I want to rotate the ring image constantly in anticlockwise direction here is my code Answer I guess the Actions are what you are looking for. An Action can be added to Actors (and subclasses) and they will be performed inside the act(delta) method, of the Actor. In your case you could use the Actions.rotateB…