停止Android应用程序进程和状态,页面打开保持不变

时间:2015-06-02 08:19:00

标签: android android-activity

在无法检索位置(gps位置)点(纬度和经度)之后,如何在条件和应用程序的打开页面需要相同后停止所有下一个进程(代码)(即, app不得关闭。)

if(provider!=null && !provider.equals("")){

        // Get the location from the given provider 
        Location location = locationManager.getLastKnownLocation(provider);

        locationManager.requestLocationUpdates(provider, 20000, 1, this);
        if(location!=null)
            onLocationChanged(location);
        else
            Toast.makeText(getBaseContext(), "Location can't be retrieved", Toast.LENGTH_SHORT).show();

    }else{
        Toast.makeText(getBaseContext(), "No Provider Found", Toast.LENGTH_SHORT).show();
    }

当第一个其他人到达应用程序中的所有其他进程时,需要停止并且需要打开一个警告框,但该应用程序不能退出。

需要打开应用页面。

0 个答案:

没有答案