我必须创建一个应用程序,显示单元格中使用的SIM卡的联系号码.为此,我需要使用TelephonyManager
课程.我可以获得它的用法细节吗?
如何在Android屏幕中创建透明活动点击以关闭按钮自动关闭活动.请提供任何解决方案.
我正在开发一个微调器这个微调器我是字符串数组
spinner = (Spinner)this.findViewById(R.id.mlg);
final CharSequence[] itemArray =getResources().getTextArray(R.array.RectBeam);
final List<CharSequence> itemList =new ArrayList<CharSequence>(Arrays.asList(itemArray));
adapter = new ArrayAdapter(this,android.R.layout.simple_spinner_item,itemList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view,
int pos, long id) {
Toast.makeText(parent.getContext(), "The planet is " +
parent.getItemAtPosition(pos).toString(), Toast.LENGTH_LONG).show();
}
Run Code Online (Sandbox Code Playgroud)
............................
<string-array name="RectBeam">
<item value="3000000" > Steel</item></string-array>
Run Code Online (Sandbox Code Playgroud)
这是微调器相关的字符串数组我得到的微调器项目我正在使用parent.getItemAtPosition(pos).toString(),完成我的问题是特定的项值如何获得
example : steel----------->3000000
Run Code Online (Sandbox Code Playgroud) 我在我的应用程序中使用了库布局.当用户从左到右移动图库中的图片时它正在工作(它是无限的,意味着元素再次重复).但是当用户从右向左移动并到达第一个元素时,它不会.之后就没有元素了.但是我也要重复这一方面的要素.你能给我一些建议吗?
Gallery g = (Gallery) findViewById(R.id.gallery);
g.setAdapter(new ImageAdapter(this));
g.setFocusable(true);
g.setSelection((int)(Integer.MAX_VALUE / 2) - (Integer.MAX_VALUE / 2)% mImageIds.length);
g.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int position, long id)
{
try {
imageid=position;
((ImageView)findViewById(R.id.ImageViewlarge)).setImageResource(mImageIds[position]);
((TextView)findViewById(R.id.TextViewImageName)).setText(imgNames[position]);
mp = MediaPlayer.create(SeaSpell.this,audioTrack[position]);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
Run Code Online (Sandbox Code Playgroud)
如何让我的画廊视图循环?我可以无限地从左到右进行,但是当我从右向左拖动时,它显示了终点.
我工作一个应用程序图像上传到SD卡我正在缩放sdcard保存到数据库有时一个错误发生位图大小超过vm预算
ouput :
01-11 15:39:51.809: ERROR/AndroidRuntime(6214): Uncaught handler: thread main exiting due to uncaught exception
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): java.lang.OutOfMemoryError: bitmap size exceeds VM budget
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:384)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:397)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at com.fitzgeraldsoftware.shout.presentationLayer.Shout.onActivityResult(Shout.java:1653)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.Activity.dispatchActivityResult(Activity.java:3624)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.deliverResults(ActivityThread.java:3220)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3266)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread.access$2600(ActivityThread.java:116)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1823)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.os.Handler.dispatchMessage(Handler.java:99)
01-11 15:39:51.979: ERROR/AndroidRuntime(6214): at android.os.Looper.loop(Looper.java:123) …
Run Code Online (Sandbox Code Playgroud) Hai,在我的计算器应用程序中,当我点击计算按钮结果正常出现,但是当我改变方向时,计算结果正在消失.
我该如何实现此功能?
ApplicationConstants.phoneContacts.add(
new ContactNumberBean(nameOfContact,
contactNumber, contactNumberType));
Run Code Online (Sandbox Code Playgroud)
ApplicationConstants和ContactNumberBean类
ContactNumberBean:
package com.example.AddressBook;
public class ContactNumberBean
{
private String nameOfContact;
private String contactNumber;
private int contactNumberType;
public String getnameOfContact()
{
return nameOfContact;
}
public String getcontactNumber()
{
return contactNumber;
}
public int getcontactNumberType()
{
return contactNumberType;
}
public ContactNumberBean(String nameOfContact, String contactNumber,int contactNumberType)
{
this.nameOfContact=nameOfContact;
this.contactNumber=contactNumber;
this.contactNumberType=contactNumberType;
}
}
Run Code Online (Sandbox Code Playgroud)
ApplicationConstants:
package com.example.AddressBook;
import java.util.ArrayList;
public class ApplicationConstants
{
//String[] phoneContacts =new String[10];
//ArrayList<NameValuePair> list = new ArrayList<NameValuePair>();
/*String s1,s2;
int i1;
ContactNumberBean cb …
Run Code Online (Sandbox Code Playgroud) i am developing android application using Geocoder services,
I have an application where I try to get address of a location based on
the latitude,longitude coordinates its working fine.
my problem is how to get continent of particular address.
Run Code Online (Sandbox Code Playgroud)
例如:double lat = 17; double lon = 78.49;
List addresses = new Geocoder(Shout.this,Locale.getDefault()).getFromLocation(lat,lon,1);
我使用此代码输出的是印度,海德拉巴这个地址相关如何查找大陆,请帮我一些有价值的解决方案.
我正在使用地理编码器动态获取国家名称是他们有机会获得大陆名称以及country.it很难静态维护我需要动态任何免费服务找到基于大陆的服务
提前致谢
在我的应用程序中我输入对话框中的电话号码,在编辑文本中输入手机号码自动添加到" - "示例:999-999-9999这个电话号码格式
final EditText text= (EditText)myDialog.findViewById(com.fitzgeraldsoftware.mobitrack.presentationlayer.R.id.Tv2);
text.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
boolean flag = true;
String eachBlock[] = text.getText().toString().split("-");
// Log.v("11111111111111111111","aa"+flag);
for (int i = 0; i < eachBlock.length; i++)
{
Log.v("11111111111111111111","aa"+i);
if (eachBlock[i].length() > 3)
{
// Log.v("11111111111111111111","cc"+flag);
flag = false;
}
}
if (flag) {
// Log.v("11111111111111111111","dd"+flag);
text.setOnKeyListener(new OnKeyListener() {
public boolean onKey(View v, int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_DEL)
// Log.v("11111111111111111111","ee"+keyDel);
keyDel = 1; …
Run Code Online (Sandbox Code Playgroud) 我正在实施通知我的应用程序只是示例
服务类文件:
public class Services
{
public void myNotify(Context context,String message)
{
Log.v("my notification method","from GetNotification class");
NotificationManager notificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(0,"A new notification", System.currentTimeMillis());
// Hide the notification after its selected
notification.flags |= Notification.FLAG_AUTO_CANCEL;
Log.v("services","11");
//Intent intent = new Intent(android.content.Intent.ACTION_VIEW,Uri.parse(""));
Log.v("services","22");
PendingIntent activity = PendingIntent.getActivity(context,0,new Intent(android.content.Intent.ACTION_VIEW,Uri.parse("")), 0);
Log.v("services","33");
notification.setLatestEventInfo(context,"Notification for you",message,activity);
Log.v("services","44");
notification.number += 1;
Log.v("services","55");
notificationManager.notify(0, notification);
Log.v("services","66");
}
Run Code Online (Sandbox Code Playgroud)
}
AppActivity主类:
public class AndroidPlatformservices extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main); …
Run Code Online (Sandbox Code Playgroud)