android意图在android 11中打开Google地图不再工作但可以在较低的API上工作
我们有这个功能
Intent mapIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + PICK_LATITUDE + "," + PICK_LONGITUDE ));
mapIntent.setPackage("com.google.android.apps.maps");
if (mapIntent.resolveActivity(getPackageManager()) != null) {
startActivity(mapIntent);
}else{
Snackbar.make(root, "Google apps is not installed" , Snackbar.LENGTH_SHORT).show();
}
Run Code Online (Sandbox Code Playgroud)
Android studio 显示了这个建议:
调用此方法时,请考虑在清单中添加声明;有关详细信息,请参阅https://g.co/dev/packagevisibility
您好,我想检查用户电子邮件是否仅在控制器中的一个功能中进行验证,我不想在中间件或路径中设置检查,如下所示:
public function __construct()
{
$this->middleware('verified');
}
Run Code Online (Sandbox Code Playgroud)
因为控制器可供访客访问,所以控制器中只有一项功能(创建)需要验证电子邮件和用户登录,我该怎么做,谢谢
public function create()
{
// checking if authenticated but need to check if email verified also
if (Auth::check()) {
// Get the currently authenticated user...
$user = Auth::user();
// get the list of states
$states = State::orderBy('name', 'asc')->get();
// get all cities by state_id
$state_id = '1';
$cities = City::where('state_id', $state_id)->orderBy('name', 'asc')->get();
return view('pages.create_product', ['user' => $user, 'states' => $states, 'cities' => $cities]);
} else {
return redirect()->route('login');
}
}
Run Code Online (Sandbox Code Playgroud)