Solved

NullPointerException in Android App on creating new Intent

Posted on 2014-11-21
6
873 Views
Last Modified: 2014-12-15
Hi,
The NullPointerException occurs at the line :
        Intent callActivityIntent = new Intent(getActivity(), CallActivity.class);
of BasePreCallSegment.java file.


I have the following CallActivity.java file :
package kujo.app.ui.activecall;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.WindowManager;

import java.util.ArrayList;
import java.util.Arrays;

import co.kujo.contact.ContactService;
import kujo.app.AuthManager;
import kujo.app.BuildConfig;
import kujo.app.CallManager;
import kujo.app.CallState;
import kujo.app.ICallStateListener;
import kujo.app.PSTNCallRecordsHelper;
import kujo.app.PSTNCallStateEventPublisher;
import kujo.app.R;
import kujo.app.SoundManager;
import kujo.app.application.VoipApplication;
import kujo.app.ui.BaseLoggedInActivity;
import kujo.app.ui.home.ContactItem;
import kujo.onboarding.UserProfile;
import to.talk.error.ErrorReporter;
import to.talk.logging.Logger;
import to.talk.logging.LoggerFactory;

public class CallActivity extends BaseLoggedInActivity {
    private static final String CURRENT_FRAGMENT_NAME = "current_fragment_name";
    public static final String EXTRA_CALL_STATE = "extra_call_state";
    private volatile ArrayList<CallItem> _currentCallList = new ArrayList<CallItem>(); //we use array list to pass in bundle and avoid type-cast
    private CallManager _callManager;
    private ICallStateListener _callListener;
    public static String EXTRA_CALL = "extra_call";
    public static String EXTRA_CALL_LIST = "extra_call_list";
    private Logger _logger = LoggerFactory.getTrimmer(CallActivity.class.getSimpleName());
    private volatile boolean _isCallStatsFragmentOpened = false;
    private volatile String _currentCallFragmentName = null;
    private boolean _isSavedBundleInOnCreateNull = true;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
                WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
                WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
                WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
        setContentView(R.layout.active_call_activity);
        _callManager = CallManager.getInstance();
        _isSavedBundleInOnCreateNull = (savedInstanceState == null);
        if (savedInstanceState == null) //activity first time
        {
            CallItem callItem = getIntent().getParcelableExtra(EXTRA_CALL);
            _currentCallList.add(callItem);
            UserProfile userProfile = VoipApplication.getOnboardingService().getUserProfile();
            ContactItem contact = callItem.getContact();
            AuthManager.AuthParams params = AuthManager.generateAuthParams(userProfile.getGuid(), userProfile.getToken(), contact.getPhoneNumber());
            callItem.setUniqueCallIdentifier(params.getCallId());
            _callManager.call(callItem, params);
            SoundManager.getInstance().setIsSpeakerEnabled(false);
            SoundManager.getInstance().setIsMuteEnabled(false, false);
            ContactService.getInstance().addToRecents(contact.getPhoneNumber());
            _currentCallFragmentName = getRelevantFragmentClassName(_currentCallList);
            Fragment fragment = getFragmentInstance(_currentCallFragmentName, _currentCallList);
            getSupportFragmentManager().beginTransaction().add(R.id.fragment_container, fragment).commit();
        } else {
            _currentCallList = savedInstanceState.getParcelableArrayList(EXTRA_CALL_LIST);
            _currentCallFragmentName = savedInstanceState.getString(CURRENT_FRAGMENT_NAME);
        }
        _logger.debug("on create, currentCall List: {}, current fragment : {}", _currentCallList, _currentCallFragmentName);
        _callListener = getCallListener();
    }

    private Fragment getFragmentInstance(String fragmentClassName, ArrayList<CallItem> callList) {
        Bundle bundle = getBundleWithCallList(callList);
        return Fragment.instantiate(CallActivity.this, fragmentClassName, bundle);
    }

    private Bundle getBundleWithCallList(ArrayList<CallItem> callList) {
        Bundle bundle = new Bundle();
        bundle.putParcelableArrayList(EXTRA_CALL, callList);
        CallItem callItem = callList.get(0);
        String uniqueIdentifier = callItem.getUniqueIdentifier();
        CallState callState = _callManager.getCallState(uniqueIdentifier);
        if (callState == null) {
            throw new NullPointerException("call state is null, isSavedBundleNullInOnCreate" +
                    _isSavedBundleInOnCreateNull);
        }
        _logger.debug("call state name in bundle: {}", callState.name());
        bundle.putString(EXTRA_CALL_STATE, callState.name());
        return bundle;
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        if (outState == null) {
            outState = new Bundle();
        }
        outState.putParcelableArrayList(EXTRA_CALL_LIST, _currentCallList);
        outState.putString(CURRENT_FRAGMENT_NAME, _currentCallFragmentName);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.active_call_activity_menu, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onPrepareOptionsMenu(Menu menu) {
        boolean isVisible = !BuildConfig.BUILD_TYPE.equals("release") &&
                isAnyCallConnected(_currentCallList) && !_isCallStatsFragmentOpened;
        menu.findItem(R.id.call_stats).setVisible(isVisible);
        return super.onPrepareOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int itemId = item.getItemId();
        switch (itemId) {
            case android.R.id.home:
                onBackPressed();
                return true;
            case R.id.call_stats:
                _isCallStatsFragmentOpened = true;
                setAppropriateFragment(_currentCallList);
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

    private void setAppropriateFragmentOnUIThread(final ArrayList<CallItem> callList) {
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                setAppropriateFragment(callList);
            }
        });
    }

    private void setAppropriateFragment(ArrayList<CallItem> callList) {
        String fragmentClassName = getRelevantFragmentClassName(callList);
        _logger.debug("appropriate class name: {}", fragmentClassName);
        if (!_currentCallFragmentName.equals(fragmentClassName)) {
            FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
            Fragment fragment = getFragmentInstance(fragmentClassName, callList);
            transaction.replace(R.id.fragment_container, fragment);
            transaction.commitAllowingStateLoss();
//            getActionBar().setDisplayHomeAsUpEnabled(_isCallStatsFragmentOpened);
            invalidateOptionsMenu();
            _currentCallFragmentName = fragmentClassName;
        } else {
            _logger.debug("refresh for instance class: {}", fragmentClassName);
            Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.fragment_container);
            if (fragment == null) {
                _logger.debug("fragment fetched is null.. should not happen!");
            } else {
                Bundle bundle = getBundleWithCallList(callList);
                ((BaseCallFragment) fragment).refresh(bundle);
            }
        }
    }

    private String getRelevantFragmentClassName(ArrayList<CallItem> callList) {
        boolean isAnyCallConnected = isAnyCallConnected(callList);
        boolean isEveryCallCompleted = isEveryCallCompleted(callList);
        boolean anyCallHangRequested = isAnyCallHangRequested(callList);
        Class fragmentClass;
        if (isAnyCallConnected) {
            fragmentClass = _isCallStatsFragmentOpened ? CallStatsFragment.class : ActiveCallFragment.class;
        } else if (anyCallHangRequested) {
            fragmentClass = ActiveCallFragment.class;
        } else if (isEveryCallCompleted) {
            fragmentClass = PostCallFragment.class;
        } else {
            CallItem call = _currentCallList.get(0);
            boolean isIncomingCall = call.isIncomingCall();
            fragmentClass = isIncomingCall ? IncomingCallFragment.class : OutgoingCallFragment.class;
        }
        return fragmentClass.getName();
    }

    private boolean isAnyCallHangRequested(ArrayList<CallItem> callList) {
        for (CallItem callItem : callList) {
            boolean status = _callManager.isCallHangRequested(callItem.getUniqueIdentifier());
            if (status) {
                return true;
            }
        }
        return false;
    }

    private boolean isEveryCallCompleted(ArrayList<CallItem> callList) {
        for (CallItem call : callList) {
            boolean status = _callManager.isCallCompleted(call.getUniqueIdentifier());
            if (!status) {
                return false;
            }
        }
        return true;
    }

    private boolean isAnyCallConnected(ArrayList<CallItem> callList) {
        for (CallItem call : callList) {
            boolean status = _callManager.isCallConnected(call.getUniqueIdentifier());
            if (status) {
                return true;
            }
        }
        return false;
    }

    private ICallStateListener getCallListener() {
        return new ICallStateListener() {
            @Override
            public void onCallAdded(CallItem callItem) {
            }

            @Override
            public void onCallStateChange(final CallItem call, final CallState callState) {
                runOnUiThread(new Runnable() {
                    @Override
                    public void run() {
                        _logger.debug("new call: " + call + " callState: " + callState + " prev call list: " + _currentCallList);
                        if (_currentCallList.contains(call)) {
                            setAppropriateFragmentOnUIThread(_currentCallList);
                        } else if (Arrays.asList(CallState.CONNECTING, CallState.EARLY).contains(callState)
                                && isEveryCallCompleted(_currentCallList)) {
                            _currentCallList = new ArrayList<CallItem>();
                            _currentCallList.add(call);
                            setAppropriateFragmentOnUIThread(_currentCallList);
                        } else if (callState.equals(CallState.COMPLETED)) {
                            _currentCallList.remove(call);
                            setAppropriateFragmentOnUIThread(_currentCallList);
                        } else if (call.isIncomingCall()) {
                            //todo: ui refresh for call waiting
                            //_sipsdk.callQueued(call);
                        }
                    }
                });
            }

            @Override
            public void onCallRemoved(CallItem callItem) {
            }
        };
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (PSTNCallRecordsHelper.getInstance().isAnyPSTNCallActive()) {
            hangAllCalls();
            finish();
        } else {
            CallManager.getInstance().addListener(_callListener);
            setAppropriateFragment(_currentCallList);
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        CallManager.getInstance().removeListener(_callListener);
    }

    @Override
    public void onBackPressed() {
        if (isEveryCallCompleted(_currentCallList)) {
            finish();
        } else if (_isCallStatsFragmentOpened) {
            _isCallStatsFragmentOpened = false;
            setAppropriateFragment(_currentCallList);
        }
    }

    public void onEvent(PSTNCallStateEventPublisher.PhoneIncomingCallEvent event) {
        finish();
    }

    private void hangAllCalls() {
        _callManager.hangUpAllcalls();
    }

}

Open in new window



Following is the BasePreCallSegment.java

package kujo.app.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import kujo.app.AppSettings;
import kujo.app.application.VoipApplication;
import kujo.app.ui.activecall.CallActivity;
import kujo.app.ui.activecall.CallItem;
import kujo.app.ui.home.ContactItem;
import kujo.app.ui.home.EchoWarningDialog;
import kujo.app.ui.home.MobileDataWarningDialog;
import to.talk.kvstore.BasicKVStore;
import to.talk.kvstore.KeyValueStore;
import to.talk.logging.Logger;
import to.talk.logging.LoggerFactory;

public class BasePreCallFragment extends Fragment {
    protected static int REQUEST_CODE_MOBILE_WARNING = 106;
    protected static int REQUEST_CODE_ECHO_WARNING = 108;

    protected void requestCall(ContactItem contactItem) {
        if (new PreCallChecker().isGoodToCall(contactItem, BasePreCallFragment.this,
                getKeyValueStore(), REQUEST_CODE_MOBILE_WARNING,
                REQUEST_CODE_ECHO_WARNING)) {
            callContact(contactItem);
        }
    }

    private void callContact(ContactItem contactItem) {
        Intent callActivityIntent = new Intent(getActivity(), CallActivity.class);
        CallItem callItem = new CallItem(contactItem, false);
        callActivityIntent.putExtra(CallActivity.EXTRA_CALL, callItem);
        startActivity(callActivityIntent);
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
        if (requestCode == REQUEST_CODE_MOBILE_WARNING) {
            setMobileWarningDialogShowPref(intent);
            if (resultCode == MobileDataWarningDialog.RESULT_CODE_ACTION_DISMISSED) {
                ContactItem contactItem = extractCallItem(intent);
                callContact(contactItem);
          }
        } else if (requestCode == REQUEST_CODE_ECHO_WARNING) {
            setEchoWarningDialogShown();
            if (resultCode == EchoWarningDialog.RESULT_CODE_ACTION_PROCEED) {
                ContactItem contactItem = extractCallItem(intent);
                requestCall(contactItem);
            }
        }
    }

    public ContactItem extractCallItem(Intent intent) {
        Bundle bundle = intent.getBundleExtra(MobileDataWarningDialog.INPUT_BUNDLE);
        return bundle.getParcelable(MobileDataWarningDialog.CONTACT_ITEM);
    }

    private void setEchoWarningDialogShown() {
        KeyValueStore keyValueStore = getKeyValueStore();
        keyValueStore.putBoolean(AppSettings.ECHO_WARNING_SHOWN.name(), true);
    }

    private void setMobileWarningDialogShowPref(Intent intent) {
        boolean doNotShowAgain = intent.getBooleanExtra(MobileDataWarningDialog.DO_NOT_SHOW_AGAIN, false);
        if (doNotShowAgain) {
            KeyValueStore keyValueStore = getKeyValueStore();
            keyValueStore.putBoolean(AppSettings.DO_NOT_SHOW_MOBILE_WARNING.name(), true);
        }
    }

    private KeyValueStore getKeyValueStore() {
        //todo: fix the injection of context or kv store
        return new BasicKVStore(VoipApplication.getInstance().getApplicationContext(), AppSettings.name);
    }

}

Open in new window


Following is the Stack Trace and Thread Trace for the Exception :

Stack Trace
_________________________________
0	java.lang.NullPointerException
1		at android.content.ComponentName.<init>(ComponentName.java:75)
2		at android.content.Intent.<init>(Intent.java:3173)
3		at kujo.app.ui.BasePreCallFragment.callContact(BasePreCallFragment.java:32)
4		at kujo.app.ui.BasePreCallFragment.requestCall(BasePreCallFragment.java:27)
5		at kujo.app.ui.CallHelper$1.onSuccess(CallHelper.java:25)
6		at kujo.app.ui.CallHelper$1.onSuccess(CallHelper.java:22)
7		at com.google.common.util.concurrent.Futures$5.run(Futures.java:1231)
8		at android.os.Handler.handleCallback(Handler.java:605)
9		at android.os.Handler.dispatchMessage(Handler.java:92)
10		at android.os.Looper.loop(Looper.java:137)
11		at android.app.ActivityThread.main(ActivityThread.java:4456)
12		at java.lang.reflect.Method.invokeNative(Native Method)
13		at java.lang.reflect.Method.invoke(Method.java:511)
14		at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
15		at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
16		at dalvik.system.NativeStart.main(Native Method)


Threads
_________________________________
Thread: DConnectionManager
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2061)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1062)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: pool-19-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2061)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1062)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: pool-26-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1051)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: Binder Thread #1
0	dalvik.system.NativeStart.run(Native Method)

Thread: pool-25-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2061)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1062)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: FinalizerDaemon
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:401)
2	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
3	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
4	java.lang.Daemons$FinalizerDaemon.run(Daemons.java:168)
5	java.lang.Thread.run(Thread.java:856)

Thread: FinalizerWatchdogDaemon
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:364)
2	java.lang.Daemons$FinalizerWatchdogDaemon.run(Daemons.java:213)
3	java.lang.Thread.run(Thread.java:856)

Thread: AsyncTask #4
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	com.google.android.gms.common.a.dV(Unknown Source)
7	com.google.android.gms.ads.identifier.AdvertisingIdClient.a(Unknown Source)
8	com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source)
9	java.lang.reflect.Method.invokeNative(Native Method)
10	java.lang.reflect.Method.invoke(Method.java:511)
11	com.facebook.internal.Utility.invokeMethodQuietly(Utility.java:524)
12	com.facebook.internal.AttributionIdentifiers.getAndroidId(AttributionIdentifiers.java:85)
13	com.facebook.internal.AttributionIdentifiers.getAttributionIdentifiers(AttributionIdentifiers.java:110)
14	com.facebook.AppEventsLogger.getSessionEventsState(AppEventsLogger.java:716)
15	com.facebook.AppEventsLogger.access$600(AppEventsLogger.java:111)
16	com.facebook.AppEventsLogger$5.run(AppEventsLogger.java:673)
17	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
18	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
19	java.lang.Thread.run(Thread.java:856)

Thread: pool-1-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
7	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
8	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
9	java.lang.Thread.run(Thread.java:856)

Thread: db-callback-0
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
7	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
8	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
9	java.lang.Thread.run(Thread.java:856)

Thread: RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@41ab35a8
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:401)
2	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
3	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
4	org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102)
5	java.lang.Thread.run(Thread.java:856)

Thread: OPTMZ
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:364)
2	android.os.ConditionVariable.block(ConditionVariable.java:97)
3	crittercism.android.g.run(Unknown Source)
4	crittercism.android.co.a(Unknown Source)
5	crittercism.android.cs.run(Unknown Source)
6	java.lang.Thread.run(Thread.java:856)

Thread: RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@414c9620
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:401)
2	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
3	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
4	org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102)
5	java.lang.Thread.run(Thread.java:856)

Thread: pool-3-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
7	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
8	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
9	java.lang.Thread.run(Thread.java:856)

Thread: GC
0	dalvik.system.NativeStart.run(Native Method)

Thread: pool-5-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2061)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1062)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@41bb5cf8
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:401)
2	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
3	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
4	org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102)
5	java.lang.Thread.run(Thread.java:856)

Thread: Binder Thread #3
0	dalvik.system.NativeStart.run(Native Method)

Thread: db-reader-0
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1051)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@41bd9ed8
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:401)
2	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
3	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
4	org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102)
5	java.lang.Thread.run(Thread.java:856)

Thread: AsyncTask #1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
7	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
8	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
9	java.lang.Thread.run(Thread.java:856)

Thread: AsyncTask #2
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	com.google.android.gms.common.a.dV(Unknown Source)
7	com.google.android.gms.ads.identifier.AdvertisingIdClient.a(Unknown Source)
8	com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source)
9	java.lang.reflect.Method.invokeNative(Native Method)
10	java.lang.reflect.Method.invoke(Method.java:511)
11	com.facebook.internal.Utility.invokeMethodQuietly(Utility.java:524)
12	com.facebook.internal.AttributionIdentifiers.getAndroidId(AttributionIdentifiers.java:85)
13	com.facebook.internal.AttributionIdentifiers.getAttributionIdentifiers(AttributionIdentifiers.java:110)
14	com.facebook.Settings.publishInstallAndWaitForResponse(Settings.java:347)
15	com.facebook.Settings$2.run(Settings.java:300)
16	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
17	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
18	java.lang.Thread.run(Thread.java:856)

Thread: Signal Catcher
0	dalvik.system.NativeStart.run(Native Method)

Thread: sip_thread
0	android.os.MessageQueue.nativePollOnce(Native Method)
1	android.os.MessageQueue.next(MessageQueue.java:118)
2	android.os.Looper.loop(Looper.java:118)
3	android.os.HandlerThread.run(HandlerThread.java:60)

Thread: WebViewCoreThread
0	android.os.MessageQueue.nativePollOnce(Native Method)
1	android.os.MessageQueue.next(MessageQueue.java:118)
2	android.os.Looper.loop(Looper.java:118)
3	android.webkit.WebViewCore$WebCoreThread.run(WebViewCore.java:881)
4	java.lang.Thread.run(Thread.java:856)

Thread: java.lang.ProcessManager
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:364)
2	java.lang.ProcessManager.waitForMoreChildren(ProcessManager.java:140)
3	java.lang.ProcessManager.watchChildren(ProcessManager.java:105)
4	java.lang.ProcessManager.access$000(ProcessManager.java:40)
5	java.lang.ProcessManager$1.run(ProcessManager.java:58)

Thread: ReferenceQueueDaemon
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:364)
2	java.lang.Daemons$ReferenceQueueDaemon.run(Daemons.java:128)
3	java.lang.Thread.run(Thread.java:856)

Thread: pool-6-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:401)
2	com.mobileapptracker.MATEventQueue$Dump.run(Unknown Source)
3	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
4	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
5	java.lang.Thread.run(Thread.java:856)

Thread: pool-21-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2061)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1062)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: Binder Thread #2
0	dalvik.system.NativeStart.run(Native Method)

Thread: pool-4-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
7	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
8	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
9	java.lang.Thread.run(Thread.java:856)

Thread: pool-23-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2061)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1062)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: udp_thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1051)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: Compiler
0	dalvik.system.NativeStart.run(Native Method)

Thread: udp_thread-2
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1051)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: doorSocket
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:197)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2061)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1062)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: AsyncTask #3
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	com.google.android.gms.common.a.dV(Unknown Source)
7	com.google.android.gms.ads.identifier.AdvertisingIdClient.a(Unknown Source)
8	com.google.android.gms.ads.identifier.AdvertisingIdClient.getAdvertisingIdInfo(Unknown Source)
9	java.lang.reflect.Method.invokeNative(Native Method)
10	java.lang.reflect.Method.invoke(Method.java:511)
11	com.facebook.internal.Utility.invokeMethodQuietly(Utility.java:524)
12	com.facebook.internal.AttributionIdentifiers.getAndroidId(AttributionIdentifiers.java:85)
13	com.facebook.internal.AttributionIdentifiers.getAttributionIdentifiers(AttributionIdentifiers.java:110)
14	com.facebook.AppEventsLogger.getSessionEventsState(AppEventsLogger.java:716)
15	com.facebook.AppEventsLogger.access$600(AppEventsLogger.java:111)
16	com.facebook.AppEventsLogger$5.run(AppEventsLogger.java:673)
17	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
18	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
19	java.lang.Thread.run(Thread.java:856)

Thread: socketReader
0	org.apache.harmony.xnet.provider.jsse.NativeCrypto.SSL_read(Native Method)
1	org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl$SSLInputStream.read(OpenSSLSocketImpl.java:671)
2	to.talk.doorProxy.socket.DoorSocket.readNBytestFromSocket(DoorSocket.java:256)
3	to.talk.doorProxy.socket.DoorSocket.readLength(DoorSocket.java:245)
4	to.talk.doorProxy.socket.DoorSocket.startReadingOnSocket(DoorSocket.java:224)
5	to.talk.doorProxy.socket.DoorSocket.access$000(DoorSocket.java:31)
6	to.talk.doorProxy.socket.DoorSocket$1.onRun(DoorSocket.java:71)
7	to.talk.exception.CrashOnExceptionRunnable.run(CrashOnExceptionRunnable.java:26)
8	java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
9	java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
10	java.util.concurrent.FutureTask.run(FutureTask.java:137)
11	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
12	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
13	java.lang.Thread.run(Thread.java:856)

Thread: Thread-3295
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
7	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
8	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
9	crittercism.android.co.a(Unknown Source)
10	crittercism.android.cs.run(Unknown Source)
11	java.lang.Thread.run(Thread.java:856)

Thread: app-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1051)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: pool-12-thread-1
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:413)
6	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
7	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
8	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
9	java.lang.Thread.run(Thread.java:856)

Thread: db-writer-0
0	java.lang.Object.wait(Native Method)
1	java.lang.Thread.parkFor(Thread.java:1231)
2	sun.misc.Unsafe.park(Unsafe.java:323)
3	java.util.concurrent.locks.LockSupport.park(LockSupport.java:157)
4	java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2022)
5	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1051)
6	java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:779)
7	java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1009)
8	java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1069)
9	java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
10	java.lang.Thread.run(Thread.java:856)

Thread: RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@41bc8b20
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:401)
2	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
3	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
4	org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102)
5	java.lang.Thread.run(Thread.java:856)

Thread: RefQueueWorker@org.apache.http.impl.conn.tsccm.ConnPoolByRoute@41bd28a0
0	java.lang.Object.wait(Native Method)
1	java.lang.Object.wait(Object.java:401)
2	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:102)
3	java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:73)
4	org.apache.http.impl.conn.tsccm.RefQueueWorker.run(RefQueueWorker.java:102)
5	java.lang.Thread.run(Thread.java:856)

Thread: CookieSyncManager
0	android.os.MessageQueue.nativePollOnce(Native Method)
1	android.os.MessageQueue.next(MessageQueue.java:118)
2	android.os.Looper.loop(Looper.java:118)
3	android.webkit.WebSyncManager.run(WebSyncManager.java:90)
4	android.webkit.CookieSyncManager.run(CookieSyncManager.java:61)
5	java.lang.Thread.run(Thread.java:856)

Open in new window



Please help me find out the reason for this exception.

Thanks
0
Comment
Question by:Rohit Bajaj
  • 5
6 Comments
 

Author Comment

by:Rohit Bajaj
ID: 40457177
Hi,
Following is my current Analysis :
The NullPointerException is occuring at line :
android.content.ComponentName.<init>(ComponentName.java:75)

I checked out source for ComponentName.java . The line corresponds to the following -
public ComponentName(Context pkg, Class<?> cls) {
        mPackage = pkg.getPackageName();
        mClass = cls.getName();  -- -line No. 75
    }

Here the line on which the Exception is being thrown is : mClass = cls.getName();
But that means the CallActivity.class is being passed Null in the following function :
 private void callContact(ContactItem contactItem) {
        Intent callActivityIntent = new Intent(getActivity(), CallActivity.class);
        CallItem callItem = new CallItem(contactItem, false);
        callActivityIntent.putExtra(CallActivity.EXTRA_CALL, callItem);
        startActivity(callActivityIntent);
    }

How could this be so?? Why its being passed as NULL.

CallActivity.java is defined in the package package kujo.app.ui.activecall
BasePreCallFragment.java is in package kujo.app.ui

Can this be causing any issue ?

Following is my AndroidManifest.xml file which is inside app folder :

<?xml version="1.0" encoding="utf-8"?>
<manifest
    package="kujo.app"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
    <uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS"/>
    <uses-permission android:name="android.permission.WRITE_SETTINGS"/>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.READ_CONTACTS"/>
    <uses-permission android:name="android.permission.WRITE_CONTACTS"/>
    <uses-permission android:name="android.permission.CALL_PHONE"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.WAKE_LOCK"/>
    <uses-permission android:name="android.permission.READ_LOGS"/>
    <!--
    <uses-permission android:name="android.permission.CALL_PRIVILEGED" />
    was useless anyway as only granted to system app and
    we don't have core integration anymore with these plugins
    -->

    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.READ_PROFILE"/>

    <application
        android:name=".application.VoipApplication"
        android:allowBackup="false"
        android:icon="@drawable/app_icon"
        android:label="@string/app_name"
        android:logo="@drawable/action_bar_icon"
        android:theme="@style/AppTheme"
        >
        <meta-data
            android:name="android.app.default_searchable"
            android:value=".ui.SearchActivity"/>

        <activity
            android:name=".ui.home.HomeScreen"
            android:screenOrientation="portrait"
            >
            <intent-filter>
                <action android:name="launch_startup"/>
                <action android:name="android.intent.action.MAIN"/>
                <action android:name="startup_activity"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>

        <activity
            android:name=".ui.OnboardingActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar"
            android:windowSoftInputMode="adjustResize|stateAlwaysHidden"
            >
        </activity>

        <activity
            android:name=".ui.SearchActivity"
            android:icon="@drawable/action_bar_icon"
            android:launchMode="singleTop"
            android:noHistory="true"
            android:screenOrientation="portrait"
            >
            <intent-filter>
                <action android:name="android.intent.action.SEARCH"/>
            </intent-filter>
            <meta-data
                android:name="android.app.searchable"
                android:resource="@xml/searchable"/>
        </activity>

        <activity
            android:name=".ui.VerificationCallingDeviceActivity"
            android:label="@string/verify_number"
            android:screenOrientation="portrait">
        </activity>

        <activity
            android:name=".ui.VerificationFailedCallingDeviceActivity"
            android:label="@string/verify_number"
            android:screenOrientation="portrait">
        </activity>

        <activity
            android:name=".ui.VerificationForNonCallingDevicesActivity"
            android:label="Verify account"
            android:screenOrientation="portrait"
            />

        <activity
            android:name=".ui.VerificationFailedNonCallingDevicesActivity"
            android:label="Verify account"
            android:screenOrientation="portrait"
            />

        <activity
            android:name=".ui.VerifyAccountActivity"
            android:label="@string/verify_account"/>

        <activity
            android:name=".ui.activecall.CallActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar"
            />

        <activity
            android:name=".ui.home.AboutActivity"
            android:screenOrientation="portrait"
            />

        <activity
            android:name=".ui.dialer.DialerActivity"
            android:screenOrientation="portrait"
            />

        <activity
            android:name=".ui.CallInterceptorActivity"
            android:noHistory="true"
            >
            <intent-filter>
                <action android:name="android.intent.action.CALL_PRIVILEGED"/>
                <category android:name="android.intent.category.DEFAULT"/>
                <data android:scheme="tel"/>
            </intent-filter>
        </activity>

        <service android:name=".application.VoipStickyService"/>

        <provider
            android:name=".logging.ClientSideLogContentProvider"
            android:authorities="kujo.app.logging.ClientSideLogContentProvider"
            android:grantUriPermissions="true"/>
        <receiver
            android:name="com.mobileapptracker.Tracker"
            android:exported="true">
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER"/>
            </intent-filter>
        </receiver>
        <receiver android:name=".VolumeControlPressedReceiver">
            <intent-filter android:priority="2147483647">
                <action android:name="android.intent.action.MEDIA_BUTTON" />
                <!-- Undocumented action but currently there was no other way-->
                <action android:name="android.media.VOLUME_CHANGED_ACTION" />
            </intent-filter>
        </receiver>
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version"/>
    </application>
</manifest>

Open in new window

0
 

Author Comment

by:Rohit Bajaj
ID: 40457193
Here is BaseLoggedInActivity.java file

package kujo.app.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;

import com.facebook.AppEventsLogger;

import kujo.app.BuildConfig;
import kujo.app.KujoExecutors;
import kujo.app.application.Device;
import kujo.app.application.VoipApplication;
import kujo.onboarding.OnboardingService;
import to.talk.app.UserActivityManager;
import to.talk.logging.Logger;
import to.talk.logging.LoggerFactory;

public class BaseLoggedInActivity extends ActionBarActivity {
    protected static final String EXTRA_PARENT_ACTIVITY = "parent_activity_extra";
    private OnboardingService _onboardingService;
    private Logger _logger = LoggerFactory.getTrimmer(BaseLoggedInActivity.class.getSimpleName());

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        _onboardingService = VoipApplication.getOnboardingService();
        boolean onboardingComplete = _onboardingService.isOnboardingComplete();
        _logger.debug("onCreate base logged in activity. onboarding complete: {} {}", onboardingComplete, BaseLoggedInActivity.this.getClass().getSimpleName());
        if (!onboardingComplete) {
            Class nextClass = getActivityClass();
            if (!nextClass.equals(this.getClass())) {
                _logger.debug("Redirecting to {} and finishing current activity: {}", nextClass, BaseLoggedInActivity.this.getClass().getSimpleName());
                Intent intent = new Intent(this, getActivityClass());
                startActivity(intent);
                finish();
            }
        }
    }



    private Class<? extends BaseLoggedInActivity> getActivityClass() {
        boolean hasCreatedMCVerificationSession = _onboardingService.hasCreatedMCVerificationSession();
        boolean hasVerificationFailed = _onboardingService.hasVerificationFailed();
        _logger.debug("has created MC Verification sesion: " + hasCreatedMCVerificationSession + " has verification failed : " + hasVerificationFailed);

        if (!(hasCreatedMCVerificationSession)) {
            return OnboardingActivity.class;
        } else {
            if (hasVerificationFailed) {
                return getVerificationFailedActivity();
            } else {
                return getVerificationActivity();
            }
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (BuildConfig.IS_FB_SDK_ENABLED) {
            AppEventsLogger.activateApp(getApplicationContext(), BuildConfig.FB_APP_ID);
        }
    }

    @Override
    protected void onPause() {
        super.onPause();
        if (BuildConfig.IS_FB_SDK_ENABLED) {
//            AppEventsLogger.deactivateApp(getApplicationContext());
        }
    }

    protected Class<? extends BaseLoggedInActivity> getVerificationActivity() {
        return canPerformNumberVerificationFromCurrentDevice() ? VerificationCallingDeviceActivity.class :
                VerificationForNonCallingDevicesActivity.class;
    }

    protected Class<? extends BaseLoggedInActivity> getVerificationFailedActivity() {
        return canPerformNumberVerificationFromCurrentDevice() ? VerificationFailedCallingDeviceActivity.class
                : VerificationFailedNonCallingDevicesActivity.class;
    }

    protected boolean canPerformNumberVerificationFromCurrentDevice() {
        return Device.getInstance().canPerformNumberVerificationFromCurrentDevice();
    }

    @Override
    protected void onStop() {
        super.onStop();
        KujoExecutors.app.execute(new Runnable() {
            @Override
            public void run() {
                UserActivityManager.getInstance().decrementActiveActivities();
            }
        });
    }

    @Override
    protected void onStart() {
        super.onStart();
        KujoExecutors.app.execute(new Runnable() {
            @Override
            public void run() {
                UserActivityManager.getInstance().incrementActiveActivities();
            }
        });
    }
}

Open in new window

0
 
LVL 61

Accepted Solution

by:
gheist earned 500 total points
ID: 40458621
i think in context getactivity() yields null, so explicitly specify activity you need. (whateveractivity.this or simply 'this'
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Rohit Bajaj
ID: 40459106
Hi
But its a fragment and getactivity() returns the     activity of the current fragment. I think we cant use 'this' when accessing the current activity in a fragment
0
 

Author Comment

by:Rohit Bajaj
ID: 40460538
Hi,
I found something related to this error here -
http://stackoverflow.com/questions/11631408/android-fragment-getactivity-sometime-returns-null
Probably this could help towards the answer. But still i am unable to figure it out
0
 

Author Comment

by:Rohit Bajaj
ID: 40472398
Hi,
I too think that getActivity() is returning NULL. But the issue is that this is not happening everytime. Its happening in some random cases.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction This article is a continuation of Part-1 as evident from the title. Please visit this page (http://www.experts-exchange.com/articles/18706/Backing-up-personal-data-on-your-Android-device-Part-1.html) to read the earlier Part -1. If y…
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now