我用最新版本更新了我的SDK Android L并重启了我的eclipse即运行ADT V.22.但是当我检查更新时
Hep -> Check for updates,它说No updates were found.
我手动试图从官方下载ADT捆绑网站 ,并试图安装ADT-23.0.0.zip由Help -> Install New Software 和网站上描述的安装指导,但它给了我错误
Cannot complete the install because of a conflicting dependency.
Software being installed: Android Development Tools 23.0.0.1245622 (com.android.ide.eclipse.adt.feature.feature.group 23.0.0.1245622)
Software currently installed: Google App Engine Tools for Android 3.5.1.v201312301719-rel-r42 (com.google.gdt.eclipse.mobile.android.feature.feature.group 3.5.1.v201312301719-rel-r42)
Only one of the following can be installed at once:
ADT XML Overlay 22.6.3.v201404151837-1123206 (overlay.com.android.ide.eclipse.adt.overlay 22.6.3.v201404151837-1123206)
ADT XML Overlay 23.0.0.1245622 (overlay.com.android.ide.eclipse.adt.overlay …Run Code Online (Sandbox Code Playgroud) 我正在Webview使用一些链接创建简单的应用程序textview并打开这些链接webview而不是默认浏览器.我textview包含各种不同的URL,我试图在我的应用程序的webview中打开每个链接.
这里代码:
tv.setText("www.google.com www.facebook.com www.yahoo.com");
tv.setMovementMethod(LinkMovementMethod.getInstance());;
tv.setText(Html.fromHtml(tv.getText().toString()));
Linkify.addLinks(tv, Linkify.WEB_URLS);
WebViewClient yourWebClient = new WebViewClient()
{
// Override page so it's load on my view only
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url)
{
// This line we let me load only pages inside Firstdroid Webpage
if ( url.contains("www") == true )
// Load new URL Don't override URL Link
return false;
// Return true to override url loading (In this case do …Run Code Online (Sandbox Code Playgroud) 我试图创建一个自定义警报对话框,它大部分工作得很好.功能完美,但视图表现得很奇怪.对话框布局由按钮和列表视图组成.正如您将在下面的屏幕截图中看到的那样,按钮在顶部和底部都有一个边距.
我没有看到这些利润的任何原因,我会非常感谢一些帮助:)
由于某种原因,我无法发布我的xml布局,但我可以确定它不包含填充或任何类型的边距
Java代码:
View dialogView = ((LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.choose_catagory_dialog_layout, null, false);
Button footerButton = (Button) dialogView.findViewById(R.id.choose_catagory_dialog_footer_button);
footerButton.setOnClickListener(ButtonClickEvent);
builder = new AlertDialog.Builder(mContext);
builder.setView(dialogView);
builder.setTitle(R.string.choose_catagory);
builder.setAdapter(spinnerAdapter, ListclickEvent);
alert = builder.create();
alert.getListView().setVerticalFadingEdgeEnabled(false);
alert.setOwnerActivity((Activity) mContext);
Run Code Online (Sandbox Code Playgroud)
截图:

在我的应用程序中,我想从中选择图像Gallery并设置图像ListView.在我的ListView I have 16 rows. So when ever item click inListView open the gallery and set the image toListView中,. But my problem is some times afterstartActivityForResult(),oncreate()`方法被调用.这是onclick代码
Intent intent = new Intent(
Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
intent.setType("image/*");
startActivityForResult(
Intent.createChooser(intent, "Select File"),
SELECT_PICTURE);
Run Code Online (Sandbox Code Playgroud)
这是一个非常活跃的结果
public void onActivityResult(int requestcode, int resultcode, Intent data) {
Log.e("result", "result");
displayMetrics = this.getResources().getDisplayMetrics();
Ew = displayMetrics.widthPixels;
Eh = displayMetrics.heightPixels;
switch (requestcode) {
case SELECT_PICTURE:
if (resultcode == RESULT_OK) { …Run Code Online (Sandbox Code Playgroud) 我正在开发一个Android应用程序,我必须将文本发送到EditText其他应用程序的焦点字段.
我已经完成了API level 18使用AccessibilityService,当我找到它时EditText,我从ClipBoard粘贴数据.这是代码,
public class TestService extends AccessibilityService {
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
AccessibilityNodeInfo source = event.getSource();
if (source != null && event.getEventType() == AccessibilityEvent.TYPE_VIEW_CLICKED && event.getClassName().equals("android.widget.EditText")) {
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText("label", "TEST DATA");
clipboard.setPrimaryClip(clip);
source.performAction(AccessibilityNodeInfo.ACTION_PASTE);
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,AccessibilityNodeInfo.ACTION_PASTEAPI级别18及以上版本可用.
我们能否在API等级<18时达到相同的水平?
我在一些博客中读到它可以使用InputMethodService,我们创建自己的键盘并通过软键盘发送文本.我对此并不了解......
有人可以帮我这个.
我正在尝试进行不适用的演示.我按照本教程学习这个.
Lemme告诉我执行此任务所遵循的步骤
我使用了下面提到的代码
package com.ohn.inappbilling;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import com.hello.inappbilling.util.IabHelper;
import com.hello.inappbilling.util.IabResult;
import com.hello.inappbilling.util.Inventory;
import com.hello.inappbilling.util.Purchase;
import com.ohn.inappbilling.R;
public class MainActivity extends ActionBarActivity {
private static final String TAG = "com.hello.inappbilling";
static final String ITEM_SKU = "com.buttonclick";
IabHelper mHelper;
private Button clickButton;
private Button buyButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
buyButton = (Button) findViewById(R.id.buyButton);
clickButton = (Button) findViewById(R.id.clickButton);
clickButton.setEnabled(false);
String base64EncodedPublicKey = "******";
mHelper = new …Run Code Online (Sandbox Code Playgroud)我有一个计算总费用和收入的例子.整数数组中有一些值从字符串数组转换而来.一旦我运行代码,总和为6000并再次运行相同的代码,总和乘以12000.我如何覆盖此问题.请检查下面给出的代码..
public static int incSum=0;
int[] numbersinc = new int[theAmount.length];
for(int i=0;i<theAmount.length;i++)
{
numbersinc[i]=Integer.parseInt(theAmount[i]);
incSum=incSum+numbersinc[i];
}
Log.e("SUM INC","Sum Inc= "+incSum); <<<<<- This sum is multiplying
Run Code Online (Sandbox Code Playgroud) 我是 android 新手,最近开始学习 Android,我试图通过其唯一的 android id 获取任何 android 设备的位置。这样我就可以通过 GPS 或网络提供商跟踪大约或确切的位置。具体来说,我的意思是,每当我在应用程序中输入任何 Android ID 时,我都可以在应用程序中获取设备位置。感谢您的热心帮助。
最大值SeekBar为100然后如何将Seekbar默认值设置为50(从50%开始).搜索栏将从50开始.
我有一个示例代码,但它会从0到100开始.如果您有任何想法,请回答我...谢谢.
public class MainActivity extends Activity implements OnSeekBarChangeListener{
private SeekBar bar; // declare seekbar object variable
// declare text label objects
private TextView textProgress,textAction;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// load the layout
setContentView(R.layout.activity_main);
bar = (SeekBar)findViewById(R.id.seekBar1); // make seekbar object
bar.setOnSeekBarChangeListener(this); // set seekbar listener.
// since we are using this class as the listener the class is "this"
// make text label …Run Code Online (Sandbox Code Playgroud)