Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 11-18 22:32:51.560 3388-3388/? E/HwLauncher: Launcher dialog dismiss failed : java.lang.IllegalArgumentException: no dialog with id 1 was ever shown via Activity#showDialog
- 11-18 22:32:51.810 2862-2879/? E/BroadcastQueue: processNextBroadcast log test
- 11-18 22:32:51.820 2862-3190/? E/BroadcastQueue: processNextBroadcast log test
- 11-18 22:32:51.820 2862-3386/? E/BroadcastQueue: processNextBroadcast log test
- apply plugin: 'com.android.application'
- android {
- compileSdkVersion 26
- buildToolsVersion "26.0.1"
- defaultConfig {
- applicationId "...."
- minSdkVersion 16
- targetSdkVersion 22
- versionCode 1
- versionName "1.0"
- multiDexEnabled true
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- packagingOptions {
- exclude 'META-INF/LICENSE'
- exclude 'META-INF/LICENSE-FIREBASE.txt'
- exclude 'META-INF/NOTICE'
- }
- dexOptions {
- javaMaxHeapSize "4g"
- }
- }
- dependencies {
- compile fileTree(include: ['*.jar'], dir: 'libs')
- compile files('libs/activation.jar')
- compile 'com.android.support:appcompat-v7:21.0.3'
- compile 'com.google.firebase:firebase-database:11.2.2'
- compile 'com.google.firebase:firebase-auth:11.2.2'
- compile 'com.google.firebase:firebase-storage:11.2.2'
- compile 'com.google.android.gms:play-services:11.2.2'
- compile 'com.firebase:firebase-client-android:2.3.1'
- compile 'com.android.support.constraint:constraint-layout:+'
- compile 'com.android.support:multidex:1.0.1'
- compile 'pl.droidsonroids.gif:android-gif-drawable:1.2.8'
- compile 'com.android.support:design:26.+'
- compile 'com.android.support:support-v4:26.+'
- compile 'com.github.bumptech.glide:glide:4.2.0'
- compile 'com.squareup.picasso:picasso:2.5.2'
- compile 'com.github.jd-alexander:library:1.1.0'
- compile 'com.google.maps.android:android-maps-utils:0.5'
- compile 'com.facebook.android:facebook-android-sdk:[4,5)'
- testCompile 'junit:junit:4.12'
- annotationProcessor 'com.github.bumptech.glide:compiler:4.2.0'
- }
- apply plugin: 'com.google.gms.google-services'
- import android.content.Context;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.net.ConnectivityManager;
- import android.net.NetworkInfo;
- import android.os.Handler;
- import android.provider.Settings;
- import android.support.v7.app.AlertDialog;
- import android.support.v7.app.AppCompatActivity;
- import android.os.Bundle;
- public class splash extends AppCompatActivity {
- private static int SPLASH_TIME_OUT = 3000;
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_splash);
- // Alert Box
- AlertDialog.Builder builder1 = new AlertDialog.Builder(this);
- builder1.setTitle("Internet not connected");
- builder1.setMessage("You need to connect WiFi/Mobile-Data run this app.");
- builder1.setCancelable(false);
- builder1.setPositiveButton(
- "Go to Settings",
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- startActivity(new Intent(Settings.ACTION_SETTINGS));
- finish();
- }
- });
- builder1.setNegativeButton(
- "Cancel",
- new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- finish();
- }
- });
- //////////////////////////////
- //WifiManager wifi =(WifiManager)getApplicationContext().getSystemService(Context.WIFI_SERVICE);
- ConnectivityManager cm = (ConnectivityManager)
- getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
- NetworkInfo networkInfo = cm.getActiveNetworkInfo();
- if (networkInfo == null) {
- AlertDialog alert11 = builder1.create();
- alert11.show();
- }
- else {
- new Handler().postDelayed(new Runnable() {
- @Override
- public void run() {
- // This method will be executed once the timer is over
- // Start your app main activity
- Intent i = new Intent(splash.this, LoginActivity.class);
- startActivity(i);
- // close this activity
- finish();
- }
- }, SPLASH_TIME_OUT);
- }
- }
- }
Add Comment
Please, Sign In to add comment