I have a button link to facebook account but it connect to Google browser in my mobile (as shown) but I don't want that, I want it to take me to facebook application in my mobile and if it doesn't exist, it takes me to Google play application to download/install facebook, does anybody know how?
package com.el.dom;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
import android.view.View;
import android.view.View.OnClickListener;
public class PageAb extends Activity {
Button dclink;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.ab);
addListenerOnButton();
}
public void addListenerOnButton() {
dclink= (Button) findViewById(R.id.dctec);
dclink.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://www.facebook.com/blah"));
startActivity(browserIntent);
}
});
}
}