真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

android仿qq,android仿列表

android 仿qq更換頭像菜單怎么實現(xiàn)的

點開頭像,是一個gridview,里面編寫你所需要的圖片地址,獲取到圖片信息,顯示出來,寫一個bean,set一個圖片的String加載到bean,點擊圖片后將imageview,再getbean就行了

天鎮(zhèn)ssl適用于網(wǎng)站、小程序/APP、API接口等需要進行數(shù)據(jù)傳輸應用場景,ssl證書未來市場廣闊!成為成都創(chuàng)新互聯(lián)公司的ssl證書銷售渠道,可以享受市場價格4-6折優(yōu)惠!如果有意向歡迎電話聯(lián)系或者加微信:028-86922220(備注:SSL證書合作)期待與您的合作!

android仿QQ在對應組件位置,彈出選項框是怎么實現(xiàn)的

可以用popupwindow,dialog是達不到效果的

dialog會覆蓋到整個屏幕上面的,要么就修改dialog的theme。

android 中仿QQ顯示說說 用什么控件

這個屬于調(diào)用系統(tǒng)相冊和系統(tǒng)相機進行圖片選擇的問題

客服端代碼:

[java] view plaincopyprint?

01.package com.cn.lxz.zhaopian;

02.

03.import java.io.File;

04.import java.io.IOException;

05.import java.text.SimpleDateFormat;

06.import java.util.Date;

07.import java.util.HashMap;

08.import java.util.Map;

09.

10.import lxz.utils.android.graphics.GraphicsBitmapUtils;

11.import lxz.utils.android.net.UploadFile;

12.import lxz.utils.android.resource.AndroidClass;

13.

14.import android.app.Activity;

15.import android.app.AlertDialog;

16.import android.content.DialogInterface;

17.import android.content.DialogInterface.OnClickListener;

18.import android.content.Intent;

19.import android.content.res.Resources;

20.import android.graphics.Bitmap;

21.import android.graphics.drawable.BitmapDrawable;

22.import android.graphics.drawable.Drawable;

23.import android.net.Uri;

24.import android.os.Bundle;

25.import android.os.Environment;

26.import android.os.Handler;

27.import android.os.Message;

28.import android.provider.MediaStore;

29.import android.view.View;

30.import android.widget.Button;

31.import android.widget.EditText;

32.import android.widget.ImageView;

33.import android.widget.Toast;

34.

35.public class Activity_UploadPic extends Activity implements Handler.Callback {

36. /** Called when the activity is first created. */

37.

38. ImageView view_pic;

39. Button view_btn;

40. EditText view_et;

41. // 線程通知上傳成功

42. final Handler upLoadhand = new Handler(this);

43. String[] arrayString = { "拍照", "相冊" };

44. String title = "上傳照片";

45.

46. // 上傳的地址

47. String uploadUrl = "?";

48. String filename = "照片";

49. private static final int PHOTO_REQUEST_TAKEPHOTO = 1;// 拍照

50. private static final int PHOTO_REQUEST_GALLERY = 2;// 從相冊中選擇

51. private static final int PHOTO_REQUEST_CUT = 3;// 結(jié)果

52.

53. @Override

54. public boolean handleMessage(Message msg) {

55.

56. if (msg.obj != null) {

57. Drawable drawable = new BitmapDrawable((Bitmap) msg.obj);

58. view_pic.setBackgroundDrawable(drawable);

59. Toast.makeText(this, "獲得圖片并且頭像上傳成功", 3).show();

60. }else

61. {

62. Toast.makeText(this, "獲得圖片,但是頭像上傳失敗,請注意配置uploadUrl上傳地址", 3).show();

63. }

64.

65. return false;

66. }

67.

68. // 創(chuàng)建一個以當前時間為名稱的文件

69. File tempFile = new File(Environment.getExternalStorageDirectory(),

70. getPhotoFileName());

71.

72. // 對話框

73. OnClickListener onDialogClick = new OnClickListener() {

74. @Override

75. public void onClick(DialogInterface dialog, int which) {

76. switch (which) {

77. case 0:

78. startCamearPicCut(dialog);// 開啟照相

79. break;

80. case 1:

81. startImageCaptrue(dialog);// 開啟圖庫

82. break;

83. default:

84. break;

85. }

86. }

87.

88. private void startCamearPicCut(DialogInterface dialog) {

89. // TODO Auto-generated method stub

90. dialog.dismiss();

91. // 調(diào)用系統(tǒng)的拍照功能

92. Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);

93.

94. intent.putExtra("camerasensortype", 2);// 調(diào)用前置攝像頭

95. intent.putExtra("autofocus", true);// 自動對焦

96. intent.putExtra("fullScreen", false);// 全屏

97. intent.putExtra("showActionIcons", false);

98. // 指定調(diào)用相機拍照后照片的儲存路徑

99. intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(tempFile));

100. startActivityForResult(intent, PHOTO_REQUEST_TAKEPHOTO);

101. }

102.

103. private void startImageCaptrue(DialogInterface dialog) {

104. // TODO Auto-generated method stub

105. dialog.dismiss();

106. Intent intent = new Intent(Intent.ACTION_PICK, null);

107. intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,

108. "image/*");

109. startActivityForResult(intent, PHOTO_REQUEST_GALLERY);

110. }

111. };

112.

113. @Override

114. public void onCreate(Bundle savedInstanceState) {

115. super.onCreate(savedInstanceState);

116. setContentView(R.layout.main);

117. init();

118.

119. }

120.

121. private void init() {

122. // TODO Auto-generated method stub

123. view_pic = (ImageView) findViewById(R.id.iv);

124. view_btn = (Button) findViewById(R.id.btn);

125. view_et = (EditText) findViewById(R.id.et);

126. view_btn.setOnClickListener(new View.OnClickListener() {

127.

128. @Override

129. public void onClick(View v) {

130. // TODO Auto-generated method stub

131. AlertDialog.Builder dialog = AndroidClass.getListDialogBuilder(

132. Activity_UploadPic.this, arrayString, title,

133. onDialogClick);

134. dialog.show();

135. }

136. });

137. }

138.

139. // 使用系統(tǒng)當前日期加以調(diào)整作為照片的名稱

140. private String getPhotoFileName() {

141. Date date = new Date(System.currentTimeMillis());

142. SimpleDateFormat dateFormat = new SimpleDateFormat(

143. "'IMG'_yyyyMMdd_HHmmss");

144. return dateFormat.format(date) + ".jpg";

145. }

146.

147. @Override

148. protected void onActivityResult(int requestCode, int resultCode, Intent data) {

149. super.onActivityResult(requestCode, resultCode, data);

150. switch (requestCode) {

151. case PHOTO_REQUEST_TAKEPHOTO:

152. startPhotoZoom(Uri.fromFile(tempFile), 150);

153. break;

154.

155. case PHOTO_REQUEST_GALLERY:

156. if (data != null) {

157. startPhotoZoom(data.getData(), 150);

158. }

159. break;

160.

161. case PHOTO_REQUEST_CUT:

162. if (data != null) {

163. setPicToView(data);

164. }

165. break;

166. }

167. super.onActivityResult(requestCode, resultCode, data);

168. }

169.

170. private void startPhotoZoom(Uri uri, int size) {

171. Intent intent = new Intent("com.android.camera.action.CROP");

172. intent.setDataAndType(uri, "image/*");

173. // crop為true是設置在開啟的intent中設置顯示的view可以剪裁

174. intent.putExtra("crop", "true");

175.

176. // aspectX aspectY 是寬高的比例

177. intent.putExtra("aspectX", 1);

178. intent.putExtra("aspectY", 1);

179.

180. // outputX,outputY 是剪裁圖片的寬高

181. intent.putExtra("outputX", size);

182. intent.putExtra("outputY", size);

183. intent.putExtra("return-data", true);

184.

185. startActivityForResult(intent, PHOTO_REQUEST_CUT);

186. }

187.

188. // 將進行剪裁后的圖片顯示到UI界面上

189. private void setPicToView(Intent picdata) {

190. Bundle bundle = picdata.getExtras();

191. if (bundle != null) {

192. final Bitmap photo = bundle.getParcelable("data");

193.

194. new Thread() {

195.

196. @Override

197. public void run() {

198. byte[] photodata = GraphicsBitmapUtils.Bitmap2Bytes(photo);

199. UploadFile uploadFile = new UploadFile(uploadUrl);

200. Map parameters = new HashMap();

201. parameters.put("msg", view_et.getText().toString());

202.

203. boolean isUploadSuccess = false;

204.

205. try {

206. isUploadSuccess = uploadFile.defaultUploadMethod(

207. photodata, filename, parameters);

208. } catch (IOException e) {

209. // TODO Auto-generated catch block

210. e.printStackTrace();

211. }

212.

213. if (isUploadSuccess) {

214. upLoadhand.obtainMessage(0, photo).sendToTarget();

215. } else {

216. upLoadhand.obtainMessage(-1, null).sendToTarget();

217. }

218.

219. }

220. }.start();

221.

222. }

223. }

224.

225.}

android仿QQ右上角顯示未讀消息個數(shù),求助

監(jiān)聽消息,得到數(shù)目,在app圖標上畫出數(shù)字(canvas),然后替換桌面快捷方式

public void createShortCut(){

//創(chuàng)建快捷方式的Intent

Intent shortcutintent = new Intent("com.android.launcher.action.INSTALL_SHORTCUT");

//不允許重復創(chuàng)建

shortcutintent.putExtra("duplicate", false);

//需要現(xiàn)實的名稱

shortcutintent.putExtra(Intent.EXTRA_SHORTCUT_NAME, getString(R.string.app_name));

//快捷圖片(每次重繪logo生成一張新圖)

Parcelable icon = Intent.ShortcutIconResource.fromContext(activity, R.drawable.logo);

shortcutintent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE, icon);

//點擊快捷圖片,運行的程序主入口

shortcutintent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, new Intent());

//發(fā)送廣播。OK

sendBroadcast(shortcutintent);

}

}


當前標題:android仿qq,android仿列表
網(wǎng)頁鏈接:http://weahome.cn/article/dsdsjps.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部