|
|
|
@ -11,11 +11,18 @@ package codetoanalyze.java.checkers;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.concurrent.ThreadSafe;
|
|
|
|
|
|
|
|
|
|
import android.app.Activity;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.content.res.AssetManager;
|
|
|
|
|
import android.content.res.Configuration;
|
|
|
|
|
import android.content.res.Resources;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.util.DisplayMetrics;
|
|
|
|
|
|
|
|
|
|
class MyActivity extends Activity {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MyResources extends Resources {
|
|
|
|
|
|
|
|
|
|
public MyResources(AssetManager assets, DisplayMetrics metrics, Configuration config) {
|
|
|
|
@ -24,6 +31,16 @@ class MyResources extends Resources {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class MyView extends View {
|
|
|
|
|
|
|
|
|
|
boolean mField;
|
|
|
|
|
|
|
|
|
|
public MyView(Context c) {
|
|
|
|
|
super(c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ThreadSafe
|
|
|
|
|
public class AndroidModels {
|
|
|
|
|
|
|
|
|
@ -48,4 +65,14 @@ public class AndroidModels {
|
|
|
|
|
mField = mResources.getConfiguration();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void findViewByIdOk1(MyView view) {
|
|
|
|
|
MyView subview = (MyView) view.findViewById(-1);
|
|
|
|
|
subview.mField = true; // ok;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void findViewByIdOk2(MyActivity activity) {
|
|
|
|
|
MyView view = (MyView) activity.findViewById(-1);
|
|
|
|
|
view.mField = true; // ok;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|