Why aren't the ARObjects being drawn when the AndARActivity is called from another activity?

227 Views Asked by At

When I start the AndARActivity as the main activity, the camera is activated and the ARObjects will be drawn correctly. If I call the AndARActivity from another, normal Activity, the camera is activated, but the ARObjects will not be drawn.

Why aren't the ARObjects being drawn?

BreakoutARActivity.java

public class BreakoutARActivity extends AndARActivity

main.xml

<ImageButton
        android:id="@+id/play"
        style="@style/dashButtonStyle"
        android:layout_marginTop="20dp"
        android:contentDescription="@string/play"
        android:onClick="play"
        android:src="@drawable/play" />

manifest.xml

     <activity
        android:label="@string/app_name"
        android:name=".BreakoutLauncherActivity"
        android:screenOrientation="landscape">
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:label="@string/app_name"
        android:name=".BreakoutARActivity"
        android:screenOrientation="landscape">
         <intent-filter >
            <action android:name="ch.bfh.ti.breakoutar.activity.BreakoutARActivity" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>

BreakoutLauncherActivity.java

public class BreakoutLauncherActivity extends Activity {


@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    setContentView(R.layout.main);
}

public void play(View view){
    Intent intent = new Intent(this, BreakoutARActivity.class);
    intent.setAction(Intent.ACTION_VIEW);
    startActivity(intent);
}
0

There are 0 best solutions below