1

I have created a textview within my MainActivity and i need to pass this into my IntentService as I need to use the textview from MainActivity somewhere else. Is it possible to use the findViewById within an IntentService or is there a method in order to be able to do something similar that will allow that TextView to be used within the IntentService?

Thanks

Dbucha01
  • 55
  • 7
  • 1
    Service does not have a ui. You can use Handler or LocalBroadCastReciever or Third party library like EventBus and then update ui in Activity itself – Raghunandan Jun 04 '14 at 08:54

1 Answers1

0

You can use putExtra to save your textview id in intent:

Intent i1 = new Intent(ListaActivity.this, ListDetailActivity.class); 
i1.putExtra("YourKey", "your textview id".toString()); 
startActivity(i1);

To retrieve the information:

Intent intent = getIntent(); 
String textViewID = intent.getStringExtra("YourKey");
JorisJ1
  • 922
  • 2
  • 12
  • 22
João Marcos
  • 3,872
  • 1
  • 19
  • 14