make function for .class and .dex
This commit is contained in:
parent
8feefbefe5
commit
1d6ff63406
6 changed files with 91 additions and 24 deletions
10
java/actual/com/example/shadowing/Main.java
Normal file
10
java/actual/com/example/shadowing/Main.java
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package com.example.shadowing;
|
||||
|
||||
public class Main {
|
||||
private static String value = "actual";
|
||||
public static void actual() {}
|
||||
public static String getValue() {
|
||||
actual();
|
||||
return Main.value;
|
||||
}
|
||||
}
|
||||
10
java/dummy/com/example/shadowing/Main.java
Normal file
10
java/dummy/com/example/shadowing/Main.java
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package com.example.shadowing;
|
||||
|
||||
public class Main {
|
||||
private static String value = "dummy";
|
||||
public static void dummy() {}
|
||||
public static String getValue() {
|
||||
dummy();
|
||||
return Main.value;
|
||||
}
|
||||
}
|
||||
4
java/empty/com/example/shadowing/Empty.java
Normal file
4
java/empty/com/example/shadowing/Empty.java
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
package com.example.shadowing;
|
||||
|
||||
public class Empty {
|
||||
}
|
||||
|
|
@ -6,22 +6,25 @@ import android.os.Bundle;
|
|||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
//import android.widget.RelativeLayout;
|
||||
//import android.view.ViewGroup;
|
||||
//import android.view.View;
|
||||
import android.util.Log;
|
||||
|
||||
public class MainActivity extends Activity {
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
String txt = Main.getValue();
|
||||
String pkg_name = getApplicationContext().getPackageName();
|
||||
|
||||
LinearLayout ll = new LinearLayout(this);
|
||||
ll.setOrientation(LinearLayout.VERTICAL);
|
||||
ll.generateViewId();
|
||||
setContentView(ll);
|
||||
TextView tw = new TextView(this);
|
||||
tw.setText("Hello Void!");
|
||||
tw.setText(txt);
|
||||
tw.generateViewId();
|
||||
ll.addView(tw);
|
||||
|
||||
Log.i("SHADOWING", "App: " + pkg_name + ", txt: " + txt);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue