This file contains 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
final ProgressDialog pd = ProgressDialog.show(this, "", "Loading...", true); | |
WebView webView = (WebView) findViewById(R.id.webview); | |
webView.getSettings().setJavaScriptEnabled(true); | |
webView.loadUrl("https://www.google.com"); | |
webView.setWebViewClient(new WebViewClient() { | |
@Override | |
public void onPageFinished(WebView view, String url) { |
This file contains 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
WebView webView =(WebView) findViewById(R.id.webview); | |
webView.getSettings().setJavaScriptEnabled(true); | |
webView.loadUrl("https://www.google.com"); | |
webView.setWebChromeClient(new WebChromeClient() { | |
public void onProgressChanged(WebView view, int progress) { | |
setTitle("Loading..."); | |
setProgress(progress * 100); | |
if(progress == 100) |
This file contains 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
Bitmap icon = BitmapFactory.decodeResource(getResources(), | |
R.mipmap.ic_launcher); | |
Intent share = new Intent(Intent.ACTION_SEND); | |
share.setType("image/jpeg"); | |
ByteArrayOutputStream bytes = new ByteArrayOutputStream(); | |
icon.compress(Bitmap.CompressFormat.JPEG, 100, bytes); | |
File f = new File(Environment.getExternalStorageDirectory() | |
+ File.separator + "temporary_file.jpg"); | |
try { | |
f.createNewFile(); |
This file contains 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 abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener { | |
public enum State { | |
EXPANDED, | |
COLLAPSED, | |
IDLE | |
} | |
private State mCurrentState = State.IDLE; |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" | |
android:shape="rectangle" android:padding="10dp"> | |
<!-- you can use any color you want I used here gray color--> | |
<solid android:color="#49aa02"/> | |
<corners android:radius="10dp"/> | |
</shape> |
This file contains 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
private void sendEmail(){ | |
Intent emailIntent = new Intent(Intent.ACTION_SENDTO); | |
emailIntent.setData(Uri.parse("mailto:" + "[email protected]")); | |
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "My email's subject"); | |
emailIntent.putExtra(Intent.EXTRA_TEXT, "My email's body"); | |
try { | |
startActivity(Intent.createChooser(emailIntent, "Send email using...")); | |
} catch (android.content.ActivityNotFoundException ex) { |
This file contains 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
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.stackoverflow.com"))); | |
// for telegram channel | |
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("tg://resolve?domain=appmeraji"))); |
This file contains 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
Intent i = new Intent(Second.this, MainAct.class); | |
Bundle bndlanimation = ActivityOptions.makeCustomAnimation(getApplicationContext(), R.anim.slide_in_right, R.anim.slide_out_right).toBundle(); | |
startActivity(i,bndlanimation); | |
---------------------------------- | |
slide_out_right.xml | |
--------------------------------- | |
<?xml version="1.0" encoding="utf-8"?> |
This file contains 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 Splash extends Activity { | |
/** Duration of wait **/ | |
private final int SPLASH_DISPLAY_LENGTH = 1000; | |
/** Called when the activity is first created. */ | |
@Override | |
public void onCreate(Bundle icicle) { | |
super.onCreate(icicle); | |
requestWindowFeature(Window.FEATURE_NO_TITLE); |
NewerOlder