[AIR接入Android 平台]Ane Activity onActivityResult 处理

1
2
3
4
5
6
7
8
9
10
11
12
protected void onCreate(Bundle savedInstanceState) {
  requestWindowFeature(Window.FEATURE\_NO\_TITLE);
  LinearLayout layout;
  layout = new LinearLayout(this);
  layout.setGravity(Gravity.BOTTOM | Gravity.LEFT);
  layout.setBackgroundDrawable(null);
  setContentView(layout);
  setRequestedOrientation(1);
  super.onCreate(savedInstanceState);
   Intent intent = new Intent(this, PaymentsActivity.class);
   startActivityForResult(...);
}

思路:用一个透明的Activity 去启动SDK的Activity。这样就可以在透明的Activity中处理onActivityResult

需要限制透明Activity的横竖屏切换。

1
2
android:configChanges="keyboardHidden|orientation|screenSize"
      android:screenOrientation="portrait"/>