Note that there are some explanatory texts on larger screens.

plurals
  1. POLaunching an activity from inside a SurfaceView
    primarykey
    data
    text
    <p>I'm trying to start an Activity (StartGame) from inside of a SurfaceView once I touch in a certain spot. This code is inside the OnTouchEvent</p> <p>It won't accept what I have below, of course, but I don't know what to put in the Context space.</p> <p>I've tried my package (com.Juggle2.Menu), but that doesn't work, because it can't resolve it to a variable, and "this" doesn't work because it's a class. I don't know what else to try.</p> <pre><code>startActivity(new Intent(com.Juggle2.Menu, StartGame.class)); </code></pre> <p>This does not work because "com.Juggle2.Menu cannot be resolved to a variable"</p> <p>My Manifest is as follows</p> <p> </p> <pre><code>&lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt; &lt;activity android:name=".Juggle2" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".Menu" android:label="@string/app_name"&gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;activity android:name=".StartGame"&gt; &lt;/activity&gt; &lt;activity android:name = ".Help"&gt; &lt;/activity&gt; &lt;activity android:name = ".Options"&gt; &lt;/activity&gt; &lt;activity android:name = ".Credits"&gt; &lt;/activity&gt; &lt;/application&gt; </code></pre> <p>And my project goes com.Juggle2>Menu.java</p>
    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.
    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