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
ParseUser user = new ParseUser(); | |
user.setUsername(emailEditText.getText().toString()); | |
user.put("name", userNameEditText.getText().toString()); | |
user.setEmail(emailEditText.getText().toString()); | |
user.setPassword(userPasswordSignUpConfirmEditText.getText().toString()); | |
user.signUpInBackground(new SignUpCallback() { | |
@Override | |
public void done(ParseException e) { | |
rootView.findViewById(R.id.user_signup_progressBar).setVisibility(View.GONE); | |
if (e == 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
package tw.alphacamp.tripphotoapp; | |
import android.app.Application; | |
import com.parse.Parse; | |
import com.parse.ParseInstallation; | |
import com.parse.ParseObject; | |
import com.parse.ParseQuery; | |
import com.parse.ParseUser; | |
import tw.alphacamp.tripphotoapp.object.Photo; |
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
@Override | |
public void onMapReady(final GoogleMap googleMap) { | |
ParseQuery<Photo> photoParseQuery = ParseQuery.getQuery(Photo.class); | |
photoParseQuery.setCachePolicy(ParseQuery.CachePolicy.CACHE_ELSE_NETWORK); | |
photoParseQuery.findInBackground(new FindCallback<Photo>() { | |
@Override | |
public void done(List<Photo> photos, ParseException e) { | |
if (e == null) { | |
photoList.clear(); |
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
// before | |
NSArray *words = [NSArray arrayWithObjects:@"list", @"of", @"words", nil]; | |
// after (array with some strings and numbers) | |
NSArray *words = @[@"list", @"of", @"words", @123, @3.14]; |
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 saveContactAsync(MyContact contact) { | |
final ProgressDialog progressDialog = new ProgressDialog(this); | |
progressDialog.setTitle("Contact"); | |
progressDialog.setMessage("Create"); | |
progressDialog.show(); | |
final MongoClient mongoClient = MongoClients.create(new ConnectionString("mongodb://account:password@ds037262.mongolab.com:37262/soleildb")); | |
MongoDatabase mongoDatabase = mongoClient.getDatabase("soleildb"); | |
MongoCollection<Document> contactCollection = mongoDatabase.getCollection("account"); |
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
public interface OnTaskExecuteListener<T> { | |
public void taskDidExecuteFinish(T result); | |
} |
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
<activity android:name=".activity.DreamInfoActivity" | |
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" | |
android:label="@string/title_dream" /> |
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
public static class DatePickerFragment extends DialogFragment { | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
// Use the current time as the default values for the picker | |
final Calendar c = Calendar.getInstance(); | |
return new DatePickerDialog(getActivity(), new DatePickerDialog.OnDateSetListener() { | |
@Override |
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
public static class TimePickerFragment extends DialogFragment { | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
// Use the current time as the default values for the picker | |
final Calendar calendar = Calendar.getInstance(); | |
return new TimePickerDialog(getActivity(), new TimePickerDialog.OnTimeSetListener() { | |
@Override | |
public void onTimeSet(TimePicker view, int hourOfDay, int minute) { | |
expiredSetupCalendar.set(Calendar.HOUR_OF_DAY, hourOfDay); |