This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Determine which activities can handle the intent | |
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); | |
PackageManager packageManager = getContext().getPackageManager(); | |
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0); | |
// If there are no relevant activities, don't follow the link | |
boolean isIntentSafe = activities.size() > 0; | |
if (!isIntentSafe) { | |
// Something Wrong | |
return true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PInfo { | |
private String appname = ""; | |
private String pname = ""; | |
private String versionName = ""; | |
private int versionCode = 0; | |
private Drawable icon; | |
private void prettyPrint() { | |
Log.v(appname + "\t" + pname + "\t" + versionName + "\t" + versionCode); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'), | |
sys = require('sys'), | |
http = require('http'); | |
http.createServer(function (req, res) { | |
checkBalanceFile(req, res); | |
}).listen(8000); | |
function checkBalanceFile(req, res) { | |
fs.stat("balance", function(err) { |
NewerOlder