runtimeexception

java.lang.RuntimeException Cannot find FacesContext

六眼飞鱼酱① 提交于 2019-11-26 07:49:45
问题 I don\'t know how to continue, but I always get the \"java.lang.RuntimeException: Cannot find FacesContext\" for my new JSF 1.2 web application. I\'m sure it\'s just some configuration I can\'t find. The exception occurs with the first f: or h: tag. Already with the important <f:view> at the beginning. My index.jsp <%@ taglib uri=\"http://java.sun.com/jsf/html\" prefix=\"h\"%> <%@ taglib uri=\"http://java.sun.com/jsf/core\" prefix=\"f\"%> <%@page contentType=\"text/html\" pageEncoding=\"UTF-8

Differences between Runtime/Checked/Unchecked/Error/Exception

删除回忆录丶 提交于 2019-11-26 07:37:26
问题 What are the Runtime exceptions and what are Checked/Unchecked Exceptions and difference between Error/Exception.Why these many types? Instead Java may simply follow a simple design(just try/catch all types) to handle an abnormal condition in a program? 回答1: Throwable is at the top off all exceptions. Underneath Throwable you have Error and Exception. Underneath Exception you have RuntimeException. Java has two types of exceptions - checked and unchecked. Checked exceptions are enforced by

java.lang.RuntimeException: takePicture failed

早过忘川 提交于 2019-11-26 04:24:23
问题 when i do continuous click on Capture button (without any break), getting Runtime Exception how can i resolve this issue ? if its not possible so how may i handle this Exception ? btnCapture = (ImageButton) findViewById(R.id.btnCapture); final MediaPlayer mp = MediaPlayer.create(CameraLauncherActivity.this, R.raw.button); btnCapture.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // line where getting RuntimeException camera.takePicture(null, null,

Can&#39;t create handler inside thread which has not called Looper.prepare()

非 Y 不嫁゛ 提交于 2019-11-26 03:33:54
问题 I have an Activity, and in that I have a class. text=new Dynamictext(...); text.setText(\"txt\"); in my DynamicText java I have this code: public void setText(String text) { this.text=text; new asyncCreateText().execute(); //this.createText(text); } //private Handler handler = new Handler(); private class asyncCreateText extends AsyncTask<Void, Void, Void> { @Override protected Void doInBackground(Void... unused) { return null; } @Override protected void onPostExecute(Void unused) { } } I get

Unable instantiate android.gms.maps.MapFragment

喜夏-厌秋 提交于 2019-11-26 03:24:52
问题 I try to do a demo with google maps android v2 with very simple activity, just copy code from google page: https://developers.google.com/maps/documentation/android/start#adding_the_api_key_to_your_application for activity: package com.example.mapdemo; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } for layout:

Unable instantiate android.gms.maps.MapFragment

风流意气都作罢 提交于 2019-11-26 00:55:49
I try to do a demo with google maps android v2 with very simple activity, just copy code from google page: https://developers.google.com/maps/documentation/android/start#adding_the_api_key_to_your_application for activity: package com.example.mapdemo; import android.app.Activity; import android.os.Bundle; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } for layout: <?xml version="1.0" encoding="utf-8"?> <fragment xmlns:android="http://schemas.android.com/apk/res

Android 1.6: “android.view.WindowManager$BadTokenException: Unable to add window — token null is not for an application”

断了今生、忘了曾经 提交于 2019-11-25 22:48:28
问题 I\'m trying to open a dialog window, but every time I try to open it it throws this exception: Uncaught handler: thread main exiting due to uncaught exception android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application at android.view.ViewRoot.setView(ViewRoot.java:460) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) at android.app.Dialog.show(Dialog.java

Understanding checked vs unchecked exceptions in Java

半世苍凉 提交于 2019-11-25 21:37:34
问题 Joshua Bloch in \" Effective Java \" said that Use checked exceptions for recoverable conditions and runtime exceptions for programming errors (Item 58 in 2nd edition) Let\'s see if I understand this correctly. Here is my understanding of a checked exception: try{ String userInput = //read in user input Long id = Long.parseLong(userInput); }catch(NumberFormatException e){ id = 0; //recover the situation by setting the id to 0 } 1. Is the above considered a checked exception? 2. Is

ActionBarCompat: java.lang.IllegalStateException: You need to use a Theme.AppCompat

北城以北 提交于 2019-11-25 19:21:07
I am getting a RuntimeException on Android 2.3.5 but I am using Theme.AppCompat (res/values/themes.xml). This is the phone: http://www.gsmarena.com/samsung_galaxy_y_s5360-4117.php <!-- res/values/themes.xml --> <?xml version="1.0" encoding="utf-8"?> <resources> <style name="Theme.Styled" parent="@style/Theme.AppCompat"> <item name="actionBarStyle">@style/QueryActionBar</item> <item name="android:actionBarStyle">@style/QueryActionBar</item> </style> <style name="QueryActionBar" parent="@style/Widget.AppCompat.ActionBar"> <item name="background">@color/blueback</item> <item name="android