I want to read some text from one of the raw text files in Android application and display a line from this text file in the app. widget.
For the MainActivity, I have written a method which get an InputStream using the following code:
getBaseContext().getResources().openRawResource(R.raw.tips);
My question is how to get reference to Context in the AppwidgetProvider because the MainActivity's onCreate method won't be invoked when user is using the widget and not the app. itself. The above code results in compiler error in the widgetprovider class.