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 class SomeFragment extends Fragment { | |
MapView mapView; | |
GoogleMap map; | |
@Override | |
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
View v = inflater.inflate(R.layout.some_layout, container, false); | |
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
//Terms of Service | |
String tobeClickable = getString(R.string.tos); | |
int index = getString(R.string.terms_of_service).indexOf(tobeClickable); | |
int length = index + tobeClickable.length(); | |
//I agree to FireSonar's Terms of Service | |
Spannable spannableString = new SpannableString( | |
getString(R.string.terms_of_service)); | |
ClickableSpan clickableSpan = new ClickableSpan() { |
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 void hideSoftInputKeyBoard(View view) { | |
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); | |
if (imm != null && view != null) { | |
imm.hideSoftInputFromWindow(view.getWindowToken(), 0); | |
} | |
} |
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
{ | |
"following": [ | |
{ | |
"name" : "john doe", | |
"following" : true, | |
"created_at" : "1 hour ago", | |
"picture" : "http://i.imgur.com/DA8VXak.jpg" | |
}, | |
{ | |
"name" : "john doe", |
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 class BaseEditText extends EditText { | |
public BaseEditText(Context context) { | |
this(context, null); | |
} | |
public BaseEditText(Context context, AttributeSet attrs) { | |
this(context, attrs, 0); | |
} | |
public BaseEditText(Context context, AttributeSet attrs, int defStyle) { |
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
Cursor cursor = getContentResolver().query(Media.EXTERNAL_CONTENT_URI, new String[]{Media.DATA, Media.DATE_ADDED, MediaStore.Images.ImageColumns.ORIENTATION}, Media.DATE_ADDED, null, "date_added ASC"); | |
if(cursor != null && cursor.moveToFirst()) | |
{ | |
do { | |
uri = Uri.parse(cursor.getString(cursor.getColumnIndex(Media.DATA))); | |
photoPath = uri.toString(); | |
}while(cursor.moveToNext()); | |
cursor.close(); | |
} |
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
Fragment fragment = (Fragment) mPagerAdapter.instantiateItem(mPager, mPager.getCurrentItem()); |
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
final TextView tv = new TextView(this); | |
final SpannableString s = new SpannableString(result); | |
Linkify.addLinks(s, Linkify.WEB_URLS); | |
tv.setText(s); | |
tv.setMovementMethod(LinkMovementMethod.getInstance()); | |
DialogFragment dg = new DialogFragment() { | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
return new AlertDialog.Builder(getActivity()) |
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
DialogFragment dg = new DialogFragment() { | |
@Override | |
public Dialog onCreateDialog(Bundle savedInstanceState) { | |
return new AlertDialog.Builder(getActivity()) | |
.setMessage(R.string.submit_confirm_message) | |
.setPositiveButton(R.string.submit_confirm_button, new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialogInterface, int i) { | |
/*---THIS IS ADDED EXTRA--------*/ | |
postInfoToServer(); |
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
[ | |
{ | |
"IsAddedByMe": true, | |
"IsFavorite": true, | |
"Latitude": 27.684554, | |
"LocationAddress": "test", | |
"LocationId": 6068, | |
"LocationImgUrl": "http://firesonar.blob.core.windows.net/checkinlocations/test.png", | |
"LocationName": "test", | |
"Longitude": 85.333882, |
OlderNewer