I am calling a BroadcastReceiver class using AlarmManager and Pending Intent. It is scheduled for daily basis.
The following is the code for BroadCast Receiver class which is called in the Activity(It is a separate class).
public class AlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Log.d("Hello", "Hi");
Intent mIntent = context.getPackageManager().getLaunchIntentForPackage("com.foodonz.android");
if(mIntent!=null)
{
context.startActivity(mIntent);
}
}
}
The problem statement is that in this Receiver I am opening another application and I want to capture the screenshot and upload it to the server. But Window feature is not available in Broadcast receiver class and I cant implement as I am out of Activity control.
Key Challenge:
-Implement screenshot taking and uploading to server code in the following class
Any solutions for the same?