Postingan

Menampilkan postingan dengan label Inten Code

Intent - Uninstall App

Uri packageURI = Uri.parse("package:".concat("com.package.name")); Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI); startActivity(uninstallIntent);

Intent - Share Text

Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.setType("text/plain"); shareIntent.putExtra(Intent.EXTRA_TEXT, "*Contents*"); shareIntent.putExtra(Intent.EXTRA_SUBJECT, "*title*"); startActivity(Intent.createChooser(shareIntent, "*Window name*")); //Example 2 // Add edittext1 and edittext2 try { java.io.File myFile = new java.io.File(getExternalCacheDir() + "/" + edittext1.getText() + ".txt"); myFile.createNewFile(); java.io.FileOutputStream fOut = new java.io.FileOutputStream(myFile); java.io.OutputStreamWriter myOutWriter = new java.io.OutputStreamWriter(fOut); myOutWriter.append(edittext2.getText()); myOutWriter.close(); fOut.close(); Intent email = new Intent(Intent.ACTION_SEND); email.setType("*/*"); email.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(new java.io.File(getExternalCacheDir() + "/" + edittext1.getText() + ".txt"))); startActivity(Intent.createChooser(email, "S...

Intent - Minimize App

public void minimizeApp() {     Intent startMain = new Intent(Intent.ACTION_MAIN);     startMain.addCategory(Intent.CATEGORY_HOME);     startMain.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);     startActivity(startMain); }

Intent - launch App

Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.package.address"); if (launchIntent != null { startActivity(launchIntent); }

Intent - Put List Extra

//Example MainActivity Intent intent = new Intent(MainActivity.this, NewActivity.class); intent.putStringArrayListExtra("data", (ArrayList<String>) List); intent.setClass(getApplicationContext(), NewActivity.class); startActivity(intent); //Example NewActivity if (getIntent().getExtras() != null) { for(String a : getIntent().getExtras().getStringArrayList("data")) { List.add(a); } } //This will export your String List on old to new activity

Intent - Open File By Type

java.io.File _PathOpenFile = Environment.getExternalStorageDirectory(); java.io.File myFile = new java.io.File(_PathOpenFile + "/aan.zip"); java.io.File url = myFile; Uri uri = Uri.fromFile(url); Intent intent = new Intent(Intent.ACTION_VIEW); if (url.toString().contains(".doc") || url.toString().contains(".docx")) { intent.setDataAndType(uri, "application/msword"); } else if(url.toString().contains(".pdf")) { intent.setDataAndType(uri, "application/pdf"); } else if(url.toString().contains(".ppt") || url.toString().contains(".pptx")) { intent.setDataAndType(uri, "application/vnd.ms-powerpoint"); } else if(url.toString().contains(".xls") || url.toString().contains(".xlsx")) { intent.setDataAndType(uri, "application/vnd.ms-excel"); } else if(url.toString().contains(".zip") || url.toString().contains(".rar")) { intent.setDataAndType(uri, "applica...

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

TextInputLayout in Sketchware

How to find and​ highlight a word in a text field in Sketchware?

A Flash Light App in Sketchware

How to enable download in webview in Sketchware apps?

Intent - Open File By Type

Code for implementing Notifications in Sketchware

How to share an image from Drawable folder?

ActionBar back button

Animation Transtition Animation