0
我想從我的應用程序進行視頻通話到Android的Skype,但當視頻通話結束時,我需要返回到我的動畫開始意圖。 如何做到這一點?如何在行動視圖關閉時知道意圖?
我想這
public class MainActivity extends AppCompatActivity {
private Button btnSkypeCall;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btnSkypeCall = (Button) findViewById(R.id.btnCallSkype);
btnSkypeCall.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(isSkypeClientInstalled(MainActivity.this)){
Uri skypeUri = Uri.parse("skype:username?call&video=true");
Intent myIntent = new Intent(Intent.ACTION_VIEW, skypeUri);
// Restrict the Intent to being handled by the Skype for Android client only.
myIntent.setComponent(new ComponentName("com.skype.raider", "com.skype.raider.Main"));
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Initiate the Intent. It should never fail because you've already established the
// presence of its handler (although there is an extremely minute window where that
// handler can go away).
startActivity(myIntent);
}
else{
Toast.makeText(getApplicationContext(), "Skype is not found!", Toast.LENGTH_LONG).show();
}
}
});
}
public boolean isSkypeClientInstalled(Context myContext) {
PackageManager myPackageMgr = myContext.getPackageManager();
try {
myPackageMgr.getPackageInfo("com.skype.raider", PackageManager.GET_ACTIVITIES);
}
catch (PackageManager.NameNotFoundException e) {
return (false);
}
return (true);
}
}
但我沒有發現任何東西回到我的應用程序。
當視頻通話結束時,這不會返回到MainActivity。@ inner_class7 –
@YusufÇakmak它在哪裏呢? –
到skype會話頁面@ inner_class7 –