This file contains 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
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"title" | |
message:@"prompt" | |
delegate:self | |
cancelButtonTitle:@"Cancel" | |
otherButtonTitles:@"Ok", nil ]; | |
alert.tag = 10; | |
[alert show]; |
This file contains 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
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) | |
my_task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, (Void[])null); | |
else | |
my_task.execute((Void[])null); |
This file contains 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
private void checkGooglePlayServicesIsAvailable() { | |
int errorCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this); | |
if (errorCode != ConnectionResult.SUCCESS) { | |
GooglePlayServicesUtil.getErrorDialog(errorCode, this, 0).show(); | |
} | |
} |
This file contains 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
// copied from : | |
// http://stackoverflow.com/a/17492949/305135 | |
public static class UacHelper | |
{ | |
private const string uacRegistryKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System"; | |
private const string uacRegistryValue = "EnableLUA"; | |
private static uint STANDARD_RIGHTS_READ = 0x00020000; | |
private static uint TOKEN_QUERY = 0x0008; |
This file contains 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
buildTypes { | |
release { | |
//... | |
applicationVariants.all { variant -> | |
variant.outputs.each { output -> | |
output.outputFile = new File( | |
output.outputFile.parent, | |
output.outputFile.name.replace("app-release.apk", "YOURAPPNAME-${variant.versionName}.apk")) | |
} | |
} |
This file contains 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
on run {input, parameters} try | |
tell application "Finder" to set the clipboard to POSIX path of (target of window 1 as alias) | |
on error | |
beep | |
end try return input end run |
This file contains 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
AlertDialog alertDialog = new AlertDialog.Builder(this).create(); | |
alertDialog.setTitle("Reset..."); | |
alertDialog.setMessage("Are you sure?"); | |
alertDialog.setButton("OK", new DialogInterface.OnClickListener() { | |
public void onClick(DialogInterface dialog, int which) { | |
// here you can add functions | |
} | |
}); | |
alertDialog.setIcon(R.drawable.icon); | |
alertDialog.show(); |
This file contains 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
import android.app.Activity; | |
import android.os.Bundle; | |
public class actSpecial extends Activity { | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.layout_); | |
registerEvents(); |
This file contains 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
Intent intent = new Intent(FirstActivity.this, OrderScreen.class); | |
startActivity(intent); |
This file contains 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
Bundle bundle = this.getIntent().getExtras(); | |
if (bundle!=null && bundle.containsKey("input")) | |
{ | |
String txt=bundle.getString("input"); | |
} |
OlderNewer