Android: Open Facebook profile in app from username
<p>How can I open Facebook profile from username? Or which request should I use in Android to get (and open) Facebook profile.</p>

<pre><code>Intent intent;

try {
    activity.getPackageManager()
            .getPackageInfo("com.facebook.katana", 0); // Checks if FB is even installed.
    intent = new Intent(Intent.ACTION_VIEW,
            Uri.parse("fb://profile/" + famous)); // Trys to make intent with FB's URI
} catch (Exception e) {
    intent = new Intent(Intent.ACTION_VIEW,
            Uri.parse("https://www.facebook.com/" + famous)); // catches and opens a url to the desired page
}

activity.startActivity(intent);
</code></pre>

<p>Tried this but didn't work with username (goes to user's - user which is logged in - wall) and id (static inserted, shows error - couldn't load this profile)...</p>