Note that there are some explanatory texts on larger screens.

plurals
  1. POChild class of SurfaceView crashed the application
    primarykey
    data
    text
    <p>I did simple application. I had added the new class TouchView:</p> <pre><code>package com.example.lookatme; import android.content.Context; import android.view.SurfaceView; public class TouchView extends SurfaceView{ public TouchView(Context context) { super(context); } } </code></pre> <p>... and added my new view at layout:</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/rlMain" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".BlockerActivity" &gt; &lt;com.example.lookatme.TouchView android:id="@+id/tvPaint" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_alignTop="@+id/ivCenter" android:layout_marginTop="14dp" /&gt; &lt;ImageView android:id="@+id/ivCenter" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentTop="true" android:layout_centerHorizontal="true" android:src="@drawable/ic_launcher" android:contentDescription="TODO"/&gt; &lt;/RelativeLayout&gt; </code></pre> <p>At the start crashed application on the code setContentView(R.layout.activity_blocker) in activity. That i did wrong? The LogCat have same text:</p> <pre><code>10-23 18:02:03.442: W/dalvikvm(1964): threadid=1: thread exiting with uncaught exception (group=0xb57ef4f0) 10-23 18:02:03.442: E/AndroidRuntime(1964): FATAL EXCEPTION: main 10-23 18:02:03.442: E/AndroidRuntime(1964): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.lookatme/com.example.lookatme.BlockerActivity}: java.lang.ClassCastException: android.view.SurfaceView 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647) 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.os.Handler.dispatchMessage(Handler.java:99) 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.os.Looper.loop(Looper.java:130) 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.main(ActivityThread.java:3683) 10-23 18:02:03.442: E/AndroidRuntime(1964): at java.lang.reflect.Method.invokeNative(Native Method) 10-23 18:02:03.442: E/AndroidRuntime(1964): at java.lang.reflect.Method.invoke(Method.java:507) 10-23 18:02:03.442: E/AndroidRuntime(1964): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 10-23 18:02:03.442: E/AndroidRuntime(1964): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 10-23 18:02:03.442: E/AndroidRuntime(1964): at dalvik.system.NativeStart.main(Native Method) 10-23 18:02:03.442: E/AndroidRuntime(1964): Caused by: java.lang.ClassCastException: android.view.SurfaceView 10-23 18:02:03.442: E/AndroidRuntime(1964): at com.example.lookatme.BlockerActivity.onCreate(BlockerActivity.java:67) 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 10-23 18:02:03.442: E/AndroidRuntime(1964): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 10-23 18:02:03.442: E/AndroidRuntime(1964): ... 11 more 10-23 18:04:01.741: W/ActivityThread(2020): Application com.example.lookatme is waiting for the debugger on port 8100... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload