This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| colorClass = new ColorClass(); | |
| factClass = new FactClass(); | |
| layout = findViewById(R.id.relativeLayout); | |
| txt = findViewById(R.id.textFact); | |
| btn = findViewById(R.id.btn); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| buildTypes { | |
| release { | |
| postprocessing { | |
| removeUnusedCode true | |
| removeUnusedResources true | |
| obfuscate true | |
| optimizeCode true | |
| proguardFile 'proguard-rules.pro' | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -assumenosideeffects class android.util.Log{ | |
| public static boolean isLoggable(java.lang.String, int); | |
| public static int v(...); | |
| public static int i(...); | |
| public static int w(...); | |
| public static int d(...); | |
| public static int e(...); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*provide context if MyActivity is a local activity*/ | |
| Intent intent = new Intent(context,MyActivity.class); | |
| startActivity(intent); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class MainActivity extends AppCompatActivity { | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| setContentView(R.layout.activity_main); | |
| /*this references to the activity's class*/ | |
| String [] animal = this.getResources().getStringArray(R.array.animals); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| super.onCreate(savedInstanceState); | |
| /*getting a notification service*/ | |
| NotificationManager notificationManager = (NotificationManager) getSystemService(Context | |
| .NOTIFICATION_SERVICE); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| File file = new File(context.getFilesDir(), filename); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*creating a dynamic textview*/ | |
| TextView textView = new TextView(MainActivity.this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*inflating xml layout*/ | |
| LayoutInflater layoutInflater = LayoutInflater.from(MainActivity.this); | |
| layoutInflater.inflate(R.layout.activity_main,parent, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*sending local broadcast*/ | |
| Intent broadcastIntent = new Intent("custom-intent"); | |
| LocalBroadcastManager.getInstance(context).sendBroadcast(broadcastIntent); |
OlderNewer