I modify via hook CordovaActivity.java. I insert the inclusion of a striсt mode there and then in the onTouchEvent I do an endless loop:
package org.apache.cordova;
. . .
import android.os.StrictMode;
public class CordovaActivity extends Activity {
. . .
@Override
public void onCreate(Bundle savedInstanceState) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
.penaltyLog()
.build());
StrictMode.VmPolicy policy = new StrictMode.VmPolicy.Builder()
.detectAll()
.penaltyLog()
.build();
StrictMode.setVmPolicy(policy);
. . .
}
@Override
public boolean onTouchEvent(MotionEvent event) {
long a = 0;
while(true) {
a++;
if(a == 8000000000L){
return true;
}
}
}
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
int action = ev.getAction();
Log.d("dispatchTouchEvent WWW", "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW");
super.dispatchTouchEvent(ev);
long a = 0;
while(true) {
a++;
if(a == 8000000000L){
return true;
}
}
}
. . .
I see the logs in the android monitor console.
And when I touch the device I see that a popup appears with a message that the application is not responding.

But I do not see the red border around my application although I can see around other applications. I think that I either connected the strict mode or inserted the loop in the wrong place, what exactly is wrong?
