当我开始AndARActivity
作为主要活动时,相机被激活并且ARObjects
将被正确绘制。如果我AndARActivity
从另一个 normal调用Activity
,相机会被激活,但ARObjects
不会被绘制。
为什么没有ARObjects
被绘制?
BreakoutARActivity.java
public class BreakoutARActivity extends AndARActivity
主要的.xml
<ImageButton
android:id="@+id/play"
style="@style/dashButtonStyle"
android:layout_marginTop="20dp"
android:contentDescription="@string/play"
android:onClick="play"
android:src="@drawable/play" />
清单.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);
}