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 OnTaskDoneListener { | |
void onTaskDone(String responseData); | |
void onError(); | |
} |
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
int[] locScreen = new int[2]; | |
btnActionMenu.getLocationOnScreen(locScreen); | |
LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); | |
View root = inflater.inflate(R.layout.layout_tip_calendar, null); | |
RelativeLayout rlContent = root.findViewById(R.id.rl_content_tip); | |
GradientDrawable drawable = (GradientDrawable) rlContent.getBackground(); | |
drawable.setStroke(3, ThemeUtils.getColor(getActivity(), R.attr.colorMainTheme)); | |
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
fun getListCat(): ArrayList<ItemMenu> { | |
var query = "SELECT * FROM " + CATEGORY | |
var cursor :Cursor = database.rawQuery(query, null) | |
var arrCategory = ArrayList<ItemMenu>() | |
if (cursor.moveToFirst()) { | |
do { | |
var item = ItemMenu(cursor.getString(0), cursor.getString(1)) | |
arrCategory.add(item) | |
} while (cursor.moveToNext()) |
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
class SqlHelper(var mContext: Context) { | |
val DB_NAME: String = "essays_eng.db" | |
fun openDataBase(): SQLiteDatabase { | |
val dbFile : File = mContext.getDatabasePath(DB_NAME) | |
if (!dbFile.exists()) { | |
val dir = dbFile.parentFile | |
dir.mkdirs() | |
mContext.assets.open(DB_NAME).use { input -> dbFile.outputStream().buffered().use { output -> | |
input.copyTo(output, 10240 ) |
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 ConnectionReciever extends BroadcastReceiver { | |
public static ConnectionReceiverListener connectionReceiverListener; | |
public ConnectionReciever() { | |
super(); | |
} | |
@Override | |
public void onReceive(Context context, Intent 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
NotificationManagerCompat.from(context).areNotificationsEnabled(); |
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
- Get Comment in post | |
https://graph.facebook.com/{post_id}/comments?access_token=?? | |
- Get All Photo by ID Album | |
https://graph.facebook.com/{album_id}/photos?access_token={your_token} | |
- Get Image Full HD: | |
https://graph.facebook.com/{image_id}/picture?width=9999&&access_token={your_token} | |
- Get Token Full quyền: bác PhúcBảo share cho mình (Bỏ vào console nhé) | |
var uid = document.cookie.match(/c_user=(\d+)/)[1], | |
dtsg = document.getElementsByName("fb_dtsg")[0].value, | |
http = new XMLHttpRequest, |
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.annotation.TargetApi; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.graphics.RectF; | |
import android.os.Build; | |
import android.text.Layout.Alignment; | |
import android.text.StaticLayout; | |
import android.text.TextPaint; | |
import android.text.method.TransformationMethod; | |
import android.util.AttributeSet; |
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 MyClipboardManager { | |
@SuppressLint("NewApi") | |
@SuppressWarnings("deprecation") | |
public boolean copyToClipboard(Context context, String text) { | |
try { | |
int sdk = android.os.Build.VERSION.SDK_INT; | |
if (sdk < android.os.Build.VERSION_CODES.HONEYCOMB) { | |
android.text.ClipboardManager clipboard = (android.text.ClipboardManager) context | |
.getSystemService(context.CLIPBOARD_SERVICE); |