0
나는 메인 액티비티가 필요한 경우 webview를 여는 외부 라이브러리에서 함수를 호출하는 안드로이드 애플 리케이션을 가지고.안드로이드 - webview 여분의 활동을 엽니 다
웹보기를 여는 것은 문제가되지 않습니다. 내 문제는 사람/사용자가 웹보기를 닫을 때 시작됩니다. webview (나는 생각한다)는 외부 라이브러리를 호출 한 원래 앱 상단에 추가 활동이나 무언가를 열었습니다.
이제 사용자는 원래의 응용 프로그램에서 계속하기 전에 2 개의 창을 닫아야합니다.
경험이 있거나 경험 한 사람이 있습니까?
MainActivity
public class MainActivity extends Activity
{
private final String appKey = "Android.Lib.Test";
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
externalLib.Initialize(this, getIntent(), appKey);
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
외부 해방
public class externalLib
{
private static final String TAG = "externalLib";
private static int messageId;
public static void Initialize(Context context, Intent intent, String newAppKey)
{
Log.d(TAG, "initializing");
APPKEY = newAppKey;
if(intent.hasExtra("url"))
{
if(intent.getExtras().getString("url") != null)
{
Intent webViewIntent = new Intent(context, externalLibWebView.class);
webViewIntent.putExtra("url", intent.getExtras().getString("url"));
context.startActivity(webViewIntent);
}
}
if(intent.hasExtra("messageId"))
{
messageId = intent.getExtras().getInt("messageId");
Log.e(TAG, "messageId: " + messageId);
}
else
{
messageId = 0;
}
}
}
은 웹보기가 다른 URL로 리디렉션되고 웹보기 자체에서 처음으로 다시 소비되는 경우 일 수 있습니다. 일부 지불 라이브러리를 통합하는 동안이 문제가 발생했습니다 ... –
"처음으로 돌아 오는"부분에 대해 잘 모릅니다. 어떻게 이것을 해결 했습니까? – DijkeMark