• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Crete a class without associate it to a Layout

Hi!
I use Android Studio
I want to send an Integer number from an activity to a Java class, just to do some calculations and then send back the answer to the same activity.
I know how to do it with intents sending data to another activity (another Java class with an associated layout) but that I want is to do that calculations in the background without go to another screen.
I tried with Intentservice but I get a error when I try to do
Bundle recupera= getIntent().getExtras();
getExtras() appears in red and systems says "cannot resolve method getIntent()"
The question is, how can I do this?
 
Back
Top Bottom