Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B8B0C1865A for ; Thu, 28 Jan 2016 21:00:48 +0000 (UTC) Received: (qmail 46361 invoked by uid 500); 28 Jan 2016 21:00:42 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 46339 invoked by uid 500); 28 Jan 2016 21:00:42 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 46275 invoked by uid 99); 28 Jan 2016 21:00:42 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2016 21:00:42 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1B9882C1F62 for ; Thu, 28 Jan 2016 21:00:42 +0000 (UTC) Date: Thu, 28 Jan 2016 21:00:42 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-10472) NullPointerException: Attempt to invoke virtual method 'android.os.Bundle org.apache.cordova.PluginManager.onSaveInstanceState MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-10472?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D151223= 02#comment-15122302 ]=20 ASF GitHub Bot commented on CB-10472: ------------------------------------- GitHub user csantanapr opened a pull request: https://github.com/apache/cordova-android/pull/255 CB-10472 NullPointerException: org.apache.cordova.PluginManager.onSav= =E2=80=A6 =E2=80=A6eInstanceState =20 check if pluginManager is null before using it You can merge this pull request into a Git repository by running: $ git pull https://github.com/csantanapr/cordova-android CB-10472 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-android/pull/255.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #255 =20 ---- commit 907e67d2b8dc13673271182555ab66a2564448af Author: Carlos Santana Date: 2016-01-28T20:57:38Z CB-10472 NullPointerException: org.apache.cordova.PluginManager.onSaveI= nstanceState check if pluginManager is null before using it ---- > NullPointerException: Attempt to invoke virtual method 'android.os.Bundle= org.apache.cordova.PluginManager.onSaveInstanceState > -------------------------------------------------------------------------= ----------------------------------------------------- > > Key: CB-10472 > URL: https://issues.apache.org/jira/browse/CB-10472 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 5.1.0 > Environment: cordova-android 5.1.0 > Reporter: Carlos Santana > Labels: android > > pluginManager not being check for null before using it in CordovaInterfac= eImpl > 01-28 14:24:10.396 27684-27684/io.cordova.hellocordova E/AndroidRuntime= =EF=B9=95 FATAL EXCEPTION: main > Process: io.cordova.hellocordova, PID: 27684 > java.lang.NullPointerException: Attempt to invoke virtual method 'and= roid.os.Bundle org.apache.cordova.PluginManager.onSaveInstanceState()' on a= null object reference > at org.apache.cordova.CordovaInterfaceImpl.onSaveInstanceStat= e(CordovaInterfaceImpl.java:173) > at org.apache.cordova.CordovaActivity.onSaveInstanceState(Cor= dovaActivity.java:465) > at android.app.Activity.performSaveInstanceState(Activity.jav= a:1298) > at android.app.Instrumentation.callActivityOnSaveInstanceStat= e(Instrumentation.java:1288) > at android.app.ActivityThread.callCallActivityOnSaveInstanceS= tate(ActivityThread.java:3958) > at android.app.ActivityThread.performStopActivityInner(Activi= tyThread.java:3369) > at android.app.ActivityThread.handleStopActivity(ActivityThre= ad.java:3425) > at android.app.ActivityThread.access$1100(ActivityThread.java= :151) > at android.app.ActivityThread$H.handleMessage(ActivityThread.= java:1332) > at android.os.Handler.dispatchMessage(Handler.java:102) > at android.os.Looper.loop(Looper.java:135) > at android.app.ActivityThread.main(ActivityThread.java:5254) > at java.lang.reflect.Method.invoke(Native Method) > at java.lang.reflect.Method.invoke(Method.java:372) > at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run= (ZygoteInit.java:903) > at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:69= 8) > Recreate > cordova create testapp > cd testapp > cordova platform add android@5.1.0 > Modify MainActivity to launch a second Cordova Activity like this: > change MainActivity.java > Notice no init or loadUrl called, this is on purpose in our App for this = use case we want to avoid this, and let the second Activity to call loadUrl > public class MainActivity extends CordovaActivity > { > @Override > public void onCreate(Bundle savedInstanceState) > { > super.onCreate(savedInstanceState); > } > @Override > protected void onStart(){ > super.onStart(); > Intent newActivity =3D new Intent(this, MainActivity2.class); > startActivity(newActivity); > } > } > Add class io.cordova.hellocordova.MainActivity2.java > public class MainActivity2 extends CordovaActivity > { > @Override > public void onCreate(Bundle savedInstanceState) > { > super.onCreate(savedInstanceState); > // Set by in config.xml > loadUrl(launchUrl); > } > } > Add activity to AndroidManifest.xml > > Since init() or loadUrl was never called in MainActivity, pluginManager n= ever got created, this let pluginManager be null -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org For additional commands, e-mail: issues-help@cordova.apache.org