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
private <E extends RealmModel> E saveToRealm(E model) { | |
E result_model; | |
try { | |
Realm realm = Realm.getDefaultInstance(); | |
realm.beginTransaction(); | |
result_model = realm.copyToRealmOrUpdate(model); | |
realm.commitTransaction(); | |
realm.close(); | |
} catch (RealmException ex) { | |
throw ex; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android"> | |
<stroke | |
android:width="5dp" | |
android:color="@android:color/holo_blue_light" /> | |
<padding | |
android:left="2dp" | |
android:top="2dp" | |
android:right="2dp" | |
android:bottom="10dp" /> |
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
Button mBack; | |
mBack = findViewById(R.id.myBackButton); | |
mBack.setOnClickListener(new View.OnClickListener() { | |
public void onClick(View v) | |
{ | |
MyActivity.this.finish(); | |
} |
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
public class LoginActivity extends AppCompatActivity implements View.OnClickListener, TextWatcher { | |
userData user; | |
private Button mLoginButton; | |
private EditText mLoginID; | |
private EditText mLoginPW; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
mLoginID = findViewById(R.id.loginEdit); |
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
public class StartActivity extends AppCompatActivity implements ResultHandleInterface { | |
private ProgressBar mCycler; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
new APITask(this).execute(place); |
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
Date currentTime = myCalendar.getTime(); | |
SimpleDateFormat dateFormatter = new SimpleDateFormat("yyyyMMdd"); | |
SimpleDateFormat timeFormatter = new SimpleDateFormat("HHmm"); | |
timeToSend = timeFormatter.format(currentTime); | |
dateToSend = dateFormatter.format(currentTime); | |
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
// 1000 to 00001000 | |
int myNumber = 1000; | |
String.format("%08d", myNumber); |
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
String example = "AnyString"; | |
int paddingLength = 12; | |
String.format("%0"+ (paddingLength - example.length() )+"d%s",0 ,example); |
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
DispatchQueue.main.async() { | |
[unowned self] in | |
self.performSegue(withIdentifier: "toSecond", sender: nil) | |
} |