Instead of Text
, it's necessary to read the R.id.text
text from TextView = My Text, I tried a lot but failed, how, please help.
This is the line:
public class MyWidgetProvider extends AppWidgetProvider {
// String array to show text at textview on refresh
private static final String[] refreshStrings = {"Text"};
<TextView
android:id="@+id/text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text="My Text"
android:textColor="@android:color/white"
android:textSize="18sp" />
I want it to be like this:
private static final String[] refreshStrings = R.id.text;