1.让一个图片透明:
Bitmap buffer = Bitmap.createBitmap(width, border="1" Height, Bitmap.Config.ARGB_4444);buffer.eraseColor(Color.TRANSPARENT);
2.直接发送邮件:
Intent intent = new Intent(Intent.ACTION_SENDTO, Uri .fromParts( "mailto" , "test@test.com" , null ));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
3.程序控制屏幕变亮:
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = 100 / 100 .0f;
getWindow().setAttributes(lp);
4.过滤特定文本
Filter filter = myAdapter.getFilter();
filter.filter(mySearchText);
5.scrollView scroll停止事件
setOnScrollListener( new OnScrollListener(){
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
}
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (scrollState == 0 ) {
Log.i( "a" , "scrolling stopped..." );
}
}
});
6. 对于特定的程序 发起一个关联供打开
Bitmap bmp = getImageBitmap(jpg);
String path = getFilesDir().getAbsolutePath() + "/test.png" ;
File file = new File(path);
FileOutputStream fos = new FileOutputStream(file);
bmp.compress( CompressFormat.PNG, 100, fos );
fos.close();
Intent intent = new Intent();
intent.setAction(android .content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri .fromFile( new File(path)), "image/png");