I have a widget and an activity, when I start the activity, I have to read text from the TextView of the widget and show it in the TextWidget of the activity.
My rel
No, you can't. I suggest one of this ways:
in your widget:
Intent intent = new Intent(context, YourActivity.class);
Bundle b= new Bundle();
b.putString("Text", yourtext);
intent.putExtras(b);
PendingIntent pendingIntent = PendingIntent.getActivity(context, appWidgetId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
in your activity:
Intent intent=getIntent();
Bundle b= intent.getExtras();
String text= b.getString("Text", "");
In your situation, I recommend method 1.