Example usage for java.lang IllegalStateException getStackTrace

List of usage examples for java.lang IllegalStateException getStackTrace

Introduction

In this page you can find the example usage for java.lang IllegalStateException getStackTrace.

Prototype

public StackTraceElement[] getStackTrace() 

Source Link

Document

Provides programmatic access to the stack trace information printed by #printStackTrace() .

Usage

From source file:com.racoon.ampdroid.views.CurrentPlaylistView.java

public void cleanView() {
    songTitle.setText("");
    songArtist.setText("");
    duration.setText("");
    currentDuration.setText("");
    seekBar.setProgress(0);/*from  www . j av a2s . c om*/
    try {
        togglePlayButton.setBackground(getResources().getDrawable(R.drawable.ic_action_play));
    } catch (IllegalStateException e) {
        Log.d("error", e.getStackTrace().toString());
    }
    updateAttempts = 0;
}

From source file:com.racoon.ampdroid.Mp3PlayerService.java

public boolean isPlaying() {
    boolean result = false;
    if (mediaPlayer != null) {
        try {/*w  w  w.ja v  a  2s .c o  m*/
            result = mediaPlayer.isPlaying();
        } catch (IllegalStateException e) {
            Log.d("error", e.getStackTrace().toString());
        }
    }
    return result;
}

From source file:com.clemot.julian.easylib.EasyActivity.java

/**
 * Add Fragment with transition animation
 *
 * @param lastFrag    fragment/*from   w ww  . j  av  a2  s  .co m*/
 * @param frag        fragment
 * @param id          which child is loaded
 * @param transitMode mode
 * @param backStack   back stack or not
 */
public void addFragment(Fragment lastFrag, Fragment frag, int id, int transitMode, boolean backStack) {
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.setTransition(transitMode);
    fragmentTransaction.add(id, frag, frag.getClass().getName());
    // An optional name for this back stack state, or null.
    if (backStack) {
        fragmentTransaction.addToBackStack(null);
    }
    fragmentTransaction.commit();
    try {
        fragmentManager.executePendingTransactions();
    } catch (IllegalStateException iSe) {
        Log.e("MultiFrag", "Handle crash:" + iSe.getStackTrace());
    }
}

From source file:com.clemot.julian.easylib.EasyActivity.java

/**
 * Add fragment with transition animation
 *
 * @param lastFrag  fragment/*from www .  j  a v a2 s  . c om*/
 * @param frag      fragment
 * @param id        which child is loaded
 * @param animation (POP/PUSH LEFT/PUSH RIGHT)
 * @param backStack back stack or not
 */
public void addFragment(Fragment lastFrag, Fragment frag, int id, FragmentCustomAnimation animation,
        boolean backStack) {
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    addCustomAnimation(fragmentTransaction, animation);
    fragmentTransaction.add(id, frag, frag.getClass().getName());
    // An optional name for this back stack state, or null.
    if (backStack) {
        fragmentTransaction.addToBackStack(null);
    }
    fragmentTransaction.commit();
    try {
        fragmentManager.executePendingTransactions();
    } catch (IllegalStateException iSe) {
        Log.e("MultiFrag", "Handle crash:" + iSe.getStackTrace());
    }
}

From source file:com.clemot.julian.easylib.EasyActivity.java

/**
 * Add Fragment/* w  w  w .ja v a2s . co  m*/
 *
 * @param lastFrag  fragment
 * @param frag      fragment
 * @param id        which child is loaded
 * @param backStack back stack or not
 */
public void addFragment(Fragment lastFrag, Fragment frag, int id, boolean backStack) {
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.add(id, frag, frag.getClass().getName());
    // An optional name for this back stack state, or null.
    if (backStack) {
        fragmentTransaction.addToBackStack(null);
    }
    fragmentTransaction.commit();

    try {
        fragmentManager.executePendingTransactions();
    } catch (IllegalStateException iSe) {

        Log.e("MultiFrag", "Handle crash:" + iSe.getStackTrace());
    }
}

From source file:com.clemot.julian.easylib.EasyActivity.java

public void replaceFragment(Fragment lastFrag, final Fragment frag, int id, boolean backStack,
        Pair<View, String>... sharedElements) {

    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();

    fragmentTransaction.replace(id, frag, frag.getClass().getName());
    // An optional name for this back stack state, or null.
    if (backStack) {
        fragmentTransaction.addToBackStack(null);
    }//from w  w w.j  a va 2  s .  co  m

    fragmentTransaction = addTransitions(fragmentTransaction, lastFrag, frag, sharedElements);

    fragmentTransaction.commit();

    try {
        fragmentManager.executePendingTransactions();
    } catch (IllegalStateException iSe) {
        Log.e("MultiFrag", "Handle crash:" + iSe.getStackTrace());
        iSe.printStackTrace();
    }
}

From source file:com.googlesource.gerrit.plugins.supermanifest.JiriSuperManifestIT.java

private void innerTest() throws Exception {
    try {// w  w  w  .  ja  va 2s  . com
        outer();
        fail("should throw");
    } catch (IllegalStateException e) {
        StackTraceElement[] trimmed = SuperManifestRefUpdatedListener.trimStack(e.getStackTrace(),
                Thread.currentThread().getStackTrace()[1]);
        String str = Arrays.toString(trimmed);
        assertThat(str).doesNotContain("trimStackTrace");
        assertThat(str).contains("innerTest");
    }
}

From source file:org.apache.openjpa.kernel.BrokerImpl.java

public Object newInstance(Class cls) {
    assertOpen();//from ww w. j a v  a 2s.com

    if (!cls.isInterface() && Modifier.isAbstract(cls.getModifiers()))
        throw new UnsupportedOperationException(_loc.get("new-abstract", cls).getMessage());

    // 1.5 doesn't initialize classes without a true Class.forName
    if (!PCRegistry.isRegistered(cls)) {
        try {
            Class.forName(cls.getName(), true,
                    AccessController.doPrivileged(J2DoPrivHelper.getClassLoaderAction(cls)));
        } catch (Throwable t) {
        }
    }

    if (_repo.getMetaData(cls, getClassLoader(), false) == null)
        throw new IllegalArgumentException(_loc.get("no-interface-metadata", cls.getName()).getMessage());

    try {
        return PCRegistry.newInstance(cls, null, false);
    } catch (IllegalStateException ise) {
        IllegalArgumentException iae = new IllegalArgumentException(ise.getMessage());
        iae.setStackTrace(ise.getStackTrace());
        throw iae;
    }
}