@@ -121,6 +121,7 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
121121
122122 }
123123
124+ @ RequiresApi (api = Build .VERSION_CODES .JELLY_BEAN_MR1 )
124125 public void enableNotebookFromSetting () {
125126 new AlertDialog .Builder (this )
126127 .setTitle (R .string .dialog_alert )
@@ -252,50 +253,6 @@ private void createServer() {
252253
253254 }
254255
255-
256- private boolean checkNotebook () {
257- boolean isInstall , isRelease , isExtra ;
258- isInstall = isJupyterInstall ();
259- isRelease = NotebookUtil .isNotebookInstall (this );
260- isExtra = NotebookUtil .isNotebookLibInstall (this );
261-
262-
263- if (!isInstall && !isExtra ) {
264- mBinding .errorTv .setText (Html .fromHtml (getResources ().getString (R .string .jupyter_not_install )));
265- mBinding .errorTv .setOnClickListener (v -> linkToStore ());
266- mBinding .errorTv .setVisibility (View .VISIBLE );
267- return false ;
268- }
269-
270- if (!isRelease && !isExtra ) {
271- mBinding .errorTv .setText (R .string .jupyter_not_release );
272- mBinding .errorTv .setVisibility (View .VISIBLE );
273- return false ;
274- }
275-
276- if (!isExtra ) {
277- if (!NotebookUtil .extraData (this )) {
278- mBinding .errorTv .setText (R .string .install_package_fail );
279- mBinding .errorTv .setVisibility (View .VISIBLE );
280- return false ;
281- }
282- }
283- return true ;
284- }
285-
286- /**
287- * 通过包名检查jupyter是否安装
288- */
289- private boolean isJupyterInstall () {
290- PackageManager pm = getPackageManager ();
291- try {
292- pm .getPackageInfo (getString (R .string .notebook_app_id ), PackageManager .GET_ACTIVITIES );
293- return true ;
294- } catch (PackageManager .NameNotFoundException e ) {
295- return false ;
296- }
297- }
298-
299256 public static final String URL = "url" ;
300257 public static final String ACT = "act" ;
301258 protected static final String TAG = "NotebookActivity" ;
0 commit comments