我已经安装了Avg Antivirus用于测试目的.
在我尝试卸载该防病毒软件后进行测试后,防病毒软件已经提示我"您确定要删除此应用程序吗?".
该提示屏幕由防病毒应用程序生成.在那个屏幕之后,我通过OK和CANCEL Button获得了系统提示.所以,该提示是由防病毒应用程序提出的.
现在我的问题是......
如何在我的应用程序中为用户提供提示屏幕,如上所述?我知道" android.intent.action.PACKAGE_REMOVED "但它在应用程序完全卸载后收到了.
任何帮助表示赞赏.
谢谢.
当我想要自动选择多个值时,我遇到了这个setSelectedValue()方法的问题,它仍然只选择了一个.有办法吗?JListJList
String[] items = { "Item 1", "Item 2", "Item 3", "Item 4" };
final JList theList = new JList(items);
theList.setSelectedValue("Item 1",true);
theList.setSelectedValue("Item 2",true);
Run Code Online (Sandbox Code Playgroud)
此代码仅显示Item 2为已选中.
在我的Android应用程序中,我想在常规时间间隔调用特定方法,即."每5秒钟后"......我怎么能这样做......?
我使用下面的代码检查onCreate Mehod上是否连接了耳机.
但每次它给我输出没有连接.
AudioManager audio=(AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
if(audio.isWiredHeadsetOn()){
Toast.makeText(this,"Connected",Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(this,"Not Connected",Toast.LENGTH_SHORT).show();
}
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我们上面的代码有什么问题.
谢谢.
我有两个程序.
第一个没有'Buffer'接口,第二个是'Buffer'接口.
两个程序都给我相同的输出.
我的问题是.
为什么我需要创建"缓冲"接口,而我可以在没有接口的情况下获得相同的输出?
这是我的两个程序:
没有接口:
public class MainClass {
public static class producer {
maintainBuffer bf;
producer(maintainBuffer buffer) {
this.bf = buffer;
}
public void setData() {
for (int i = 0; i <= 10; i++) {
bf.set(i);
}
}
}
public static class reader {
maintainBuffer bf;
reader(maintainBuffer buffer) {
this.bf = buffer;
}
public void getData() {
System.out.println("From Reader Class:-" + bf.get());
}
public void extraData() {
System.out.println("Extra DATA");
}
}
public static class maintainBuffer { …Run Code Online (Sandbox Code Playgroud) 这是我的整个代码.......
package com.example.broadcast;
> import android.app.Activity; import
> android.content.Context; import
> android.os.Bundle; import
> android.telephony.*; import
> android.util.Log; import
> android.widget.TextView;
public class BroadcastExaple extends Activity {
TextView textOut;
TelephonyManager telephonyManager;
PhoneStateListener listener;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
try {
super.onCreate(savedInstanceState);
// Get the UI
textOut = new TextView(this);
textOut.setText("DEmoBroadCast");
setContentView(textOut);
// Get the telephony manager
telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
// Register the listener wit the telephony manager
telephonyManager.listen(listener,PhoneStateListener.LISTEN_CALL_STATE); …Run Code Online (Sandbox Code Playgroud) import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.widget.Toast;
public class ViewId extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView txtArea = new TextView(this);
txtArea.setId(20);
txtArea.setText("Hello");
TextView view = new TextView(this);
view = (TextView) this.findViewById(20);
Toast.makeText(this,view.getText(), Toast.LENGTH_LONG).show();
}
}
Run Code Online (Sandbox Code Playgroud)
当我在eclipse中调试上面的代码时,视图的值在变量窗口中显示为null.问题是什么?或者是否有任何其他方法来seviewd textview并从该特定id中检索该文本视图而不使用XML文件.
我使用Sqlite Browser创建了数据库AddressBookMaster.db,并在提到的数据库中创建了表AddressBook.但现在的问题是我想在我的应用程序中使用这个.db文件,那么我应该在哪里放置这个db文件以及如何在应用程序中获取?
是否有任何可以帮助我的示例或教程?
我使用LWUIT创建了List.
但是显示了带索引的项目.
喜欢
我想删除左侧索引1,2,3我该怎么办?
码:
class mainForm extends Form implements ActionListener{
List list;
String newkey = "";
final String COMPANY[] = {"AIRCEL", "AIRTEL", "BPL", "BSNL", "IDEA", "RELIANCE", "TATA DOCOMO", "TATA INDICOM", "UNINOR", "VIRGIN", "VIDEOCON", "VODAFONE", "AIRCEL1", "AIRTEL2", "BPL1", "BSNL1", "IDEA1", "RELIANCE1", "TATA DOCOMO1", "TATA INDICOM1", "UNINOR1", "VIRGIN1", "VIDEOCON1"};
final int CO_LENGTH = COMPANY.length;
mainForm() {
super("Main Form");
setLayout(new BoxLayout(BoxLayout.Y_AXIS));
list = new List(COMPANY);
list.addActionListener(this);
list.setPreferredW(getWidth());
addComponent(list);
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢.