illegalstateexception

android.media.audiofx.Visualizer throwing exception every other time

ぃ、小莉子 提交于 2019-12-07 02:21:32
问题 I'm making a Live Wallpaper for Android 2.3.3 and it used the Visualizer class. I've already got a working version of my Visualizer program working as a stand alone but when I place the code into a Live Wallpaper service, my problem begins. The following code is where the error exists: // Called in my Engine extension's constructor public void setupVisualizer() { mBytes = null; mVisualizer = new Visualizer(0); // EDIT mVisualizer.setEnabled(false); // This fixes the issue // END EDIT

startForegroundService() is throwing IllegalStateException in Oreo on app BOOT_COMPLETED

笑着哭i 提交于 2019-12-06 16:48:43
The application I am having (in Android O) will start a service after device reboot. Once the device is rebooted, in the onReceive() method of the broadcast receiver it is calling the service as startForegroundService() for Android OS 8 and above. if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { context.startForegroundService(intent); } else { context.startService(intent); } Inside the service class it is starting the notification from the onStartCommand() method. But still it is throwing the IllegalStateException. Did someone faced similar issues in Android OS 8 and above? You have to

java.lang.IllegalStateException: The driver executable does not exist chrome driver

半城伤御伤魂 提交于 2019-12-06 16:14:08
I would like to open url in chrome driver by applying object repository concept. Below given is my selenium programme which contain two file one is testng file and another one is config.property file chromedriver="E:\\selenium bwosers\\chromedriver.exe" url="https://www.google.co.in" I saved above programme as config.property in configuration folder package sele_prac_pkg; import java.io.File; import java.io.FileInputStream; import java.util.Properties; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.Test; public class Object

Getting IllegalStateException in MediaPlayer when trying to getCurrentPosition

久未见 提交于 2019-12-06 13:45:04
问题 I've been trying to make my trackbar work with the music player I just started working on. But when I press next, I get an Exception. Here's my code: public class ThePlayer extends AppCompatActivity { private static final String TAG = "MyActivity"; static MediaPlayer mp; int position; SeekBar mSeekBar; Button btnPlay, btnFF, btnFB, btnNext, btnPrev; int[] w2 = {R.raw.w2l01f01, R.raw.w2l01f03, R.raw.w2l01f04}; ArrayList<Integer> mysongs; Thread updateSeekBar; @Override protected void onCreate

PowerMock - Mocking static system class throws IllegalStateException

自作多情 提交于 2019-12-06 12:33:00
I have the following code public class A{ public void createFile() { File tempXmlFile = null; String extension = ".xml"; String name = "someName"; try { tempXmlFile = File.createTempFile(name, extension); if (tempXmlFile.exists()) { tempXmlFile.delete(); } } catch (IOException e) { System.out.println(e.getStackTrace()); } } } @RunWith(PowerMockRunner.class) @PrepareForTest(A.class) public class testA extends TestCase{ private A classUnderTest; @Override @Before public void setUp() { classUnderTest = PowerMock.createMock(A.class); //the class is more complex in my case and I have to mock it }

How should I try to fix java.lang.IllegalStateException in JBoss “is already registered”?

强颜欢笑 提交于 2019-12-06 04:32:16
I have a web application. When I try to deploy it via Netbeans, the JBoss server throws the following error: DEPLOYMENTS IN ERROR: Deployment "vfs:///path/to/my/Application.ear" is in error due to the following reason(s): java.lang.IllegalStateException: Container jboss.j2ee:ear=Application.ear,jar=Application-ejb.jar,name=Another,service=EJB3,VMID=583c10bfdbd326ba:71d035f1:132a4c6a8ba:-7ffd + is already registered at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA] at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete

java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory [duplicate]

我们两清 提交于 2019-12-06 00:03:26
This question already has an answer here: java.lang.IllegalStateException:Could not find backup for factory javax.faces.application.ApplicationFactory 3 answers I want to migrate from jsf 2.1 to 2.2 but I can not run my server (Tomcat) to couse of the following error: (I'm yours to inform you that I used [Hibernate + Spring + JSF] in project Maven) `Root WebApplicationContext: initialization started Refreshing org.springframework.web.context.support.XmlWebApplicationContext@37fc34bf: display name [Root WebApplicationContext]; startup date [Fri Apr 25 19:38:18 WEST 2014]; root of context

IllegalStateException with PagerAdapter

喜你入骨 提交于 2019-12-05 16:36:50
问题 I am getting an IllegalStateException within this activity but not too sure what is going on. Here is the ViewPagerAdapter class in QuickContactActivity. private class ViewPagerAdapter extends FragmentPagerAdapter { public ViewPagerAdapter(FragmentManager fragmentManager) { super(fragmentManager); } @Override public Fragment getItem(int position) { QuickContactListFragment fragment = new QuickContactListFragment(); final String mimeType = mSortedActionMimeTypes.get(position); final List

MediaPlayer.prepare() throws IllegalStateException on Android L

时光怂恿深爱的人放手 提交于 2019-12-05 12:53:57
I have code that plays mp3 file from assets directory: MediaPlayer mediaPlayer = new MediaPlayer(); descriptor = context.getAssets().openFd("beep.mp3"); mediaPlayer.setDataSource(descriptor.getFileDescriptor(), descriptor.getStartOffset(), descriptor.getLength()); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setVolume(soundLevel, soundLevel); descriptor.close(); mediaPlayer.setLooping(false); mediaPlayer.prepare(); mediaPlayer.start(); This code was working fine on every device and every Android version. Until after Android L preview came available. mediaPlayer

Rendering issue in XML preview : Unable to locate mode 0 [duplicate]

自作多情 提交于 2019-12-05 11:19:21
问题 This question already has answers here : Exception raised during rendering: Unable to locate mode 0 (6 answers) Closed 3 years ago . After updating the android studio exception occured during rendering. Exception raised during rendering: Unable to locate mode 0 java.lang.IllegalStateException: Unable to locate mode 0 at android.view.DisplayInfo.findMode(DisplayInfo.java:458) at android.view.DisplayInfo.getMode(DisplayInfo.java:445) at android.view.Display.getRefreshRate(Display.java:648) at