Oh ok, well almost same type of thread is already in discussion on
https://groups.google.com/forum/?fromgroups#!topic/robotium-developers/Oyhcq-nGX6Athe point is Robotium can't interact any view outside of the <target package> set in Manifest.xml.
The workaround is if we can get focus of specific dialog/view it will work with Robotium. You can use following code to get focus but it works in some cases only,
private void getFocus() { @SuppressWarnings("rawtypes") Class a = YourActivity.class; getInstrumentation().setInTouchMode(true); Intent intent = new Intent(Intent.ACTION_MAIN); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setClass(getInstrumentation().getTargetContext(), a); setActivity((Activity) getInstrumentation().startActivitySync(intent)); }
Hope that helps,
On Friday, June 7, 2013 1:45:54 PM UTC+5, Gennadiy Ryabkin wrote:
No, no. I know how to use this stuff and do it already long. But now I need to handle android system messages like "Not responding" alert dialogs or default "Loading" progress dialogs.I google it and found that in android some defaults buttons can be invoked by specifying the following source id paths: android.R.id.button1, android.R.id.custom
четверг, 6 июня 2013 г., 19:40:52 UTC+3 пользователь Gennadiy Ryabkin написал: