小编Yaq*_*mad的帖子

如何在Android EditText上实施DoubleClick?

我有一个"Activity1",它有一个"EditText".当用户双击"EditText"时,我想打开另一个活动"Activity2".

android double-click android-edittext

2
推荐指数
1
解决办法
8561
查看次数

findViewById()在一个活动中起作用,但在另一个活动中起作用

我试图将EditText从Activity1传递给Activity2.

Activity1代码:

public void openNextActivity() 
{
    Intent intent = new Intent("com.abc.xyz.ImageActivity"); 
    EditText myEditText = (EditText)findViewById(R.id.myEditText);

    int myEditTextId = myEditText.getId();
    //For Test purpose ----- starts
    // **Point1: next line of code works fine in this Activity1**
    EditText myEditTextTest = (EditText)findViewById(myEditTextId); 
    //For Test purpose ----- ends   

    intent.putExtra("myEditText", myEditTextId);

    startActivity(intent); 
}
Run Code Online (Sandbox Code Playgroud)

Activity2代码:

public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.comments_detail);

    Bundle extras = getIntent().getExtras();
    if(extras != null)
    {
        int myEditTextId = extras.getInt("myEditText");

        // Point2: next line of code displays the correct Id
        Log.d("tag","myEditTextId"+ myEditTextId); …
Run Code Online (Sandbox Code Playgroud)

android nullreferenceexception android-edittext android-view findviewbyid

2
推荐指数
1
解决办法
2061
查看次数

本网站无权使用Geolocation API

我正在尝试使用geolocation api时遇到此错误:

This website does not have permission to use the Geolocation API
Run Code Online (Sandbox Code Playgroud)

奇怪的是,同一个网站在某些系统(安装了IE.9和I.E10)上运行良好,并且在安装IE 9的系统上抛出错误.

我们在不同的系统上测试了它,但它只在安装了I.E9的特定系统上抛出错误.

  • 我们是否需要一些浏览器设置才能使用此API?
  • 我们的网站要求使用地理定位API需要什么?

代码:

function geolocateUser()
{
    // If the browser supports the Geolocation API
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(geolocationSuccess, geolocationError);
    }
    else {
        alert("Your browser doesn't support the Geolocation API");
    }

}
Run Code Online (Sandbox Code Playgroud)

如果成功:

function geolocationSuccess(position) {

    var userCurrentLatLong = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);



}
Run Code Online (Sandbox Code Playgroud)

如果有错误:

function geolocationError(positionError) {

    alert(positionError.message + "\n" + "you will be redirected to …
Run Code Online (Sandbox Code Playgroud)

internet-explorer geolocation

2
推荐指数
1
解决办法
5936
查看次数

SQLiteOpenHelper onCreate()总是在运行时创建数据库?

问候,

我正在寻找Android上的SQLite文档,但似乎无法找到我的问题的anser - 所以也许这里有人可以提供帮助.

当我使用SQLiteOpenHelper创建数据库时,如果数据库不存在则只创建一次,或者每次调用OnCreate方法时都会覆盖它.

sqlite android

1
推荐指数
1
解决办法
864
查看次数

我应该在SQLite数据库中存储图像吗?

我需要在SQLite中存储100个图像和声音文件.是否可以存储这些数据?

SQLite中可以存储多少MB的数据?

问候

阿斯旺

sqlite android

1
推荐指数
1
解决办法
1439
查看次数

在android中使用sqlite的优点

我在脑海中提出一个问题,为什么我们经常 在android中使用SQLITE?有更多选项可用,但为什么SQLITE?选项如::

  • 使用共享首选项
  • 使用内部存储
  • 使用外部存储
  • 使用网络连接

为什么这么容易使用

sqlite android

1
推荐指数
1
解决办法
1418
查看次数

如何停止键盘打开?

在我的应用程序中,我想EditText通过单击按钮填充我的; 用我自己的键盘.所以我不希望键盘打开,如果我点击EditText.那可能吗?

android

1
推荐指数
1
解决办法
116
查看次数

Linq-to-SQL仅搜索日期的DATE部分

我需要根据日期范围获取数据,如:

SELECT * FROM MyTable WHERE 
myDate >= 'May 17 2012' AND 
myDate <= 'May 17 2012'
Run Code Online (Sandbox Code Playgroud)

我在LINQ中编写了这个查询,问题是LINQ正在将此查询转换为:

SELECT * FROM MyTable WHERE 
myDate >= 'May 17 2012 12:00:00:000AM' AND 
myDate <= 'May 17 2012 12:00:00:000AM'
Run Code Online (Sandbox Code Playgroud)

问题是LINQ也在考虑时间部分,但我只需要搜索日期部分.

谁能帮我?

谢谢.

comparison date sql-server-2008 linq-to-sql

1
推荐指数
1
解决办法
3687
查看次数

SQLite中以下sql的替代是什么?

表' Curcommtb'有列' DModify'和' Count'

SQLite中以下sql的替代是什么?

' select dateadd(day,count,DModify) from Curcommtb'

sqlite dateadd

1
推荐指数
1
解决办法
3894
查看次数

Java Generics - 这个语法是什么?

下面这部分代码<String, Void, Bitmap>是什么意思?我甚至都不知道甚至调用了这种语法.

private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {

}
Run Code Online (Sandbox Code Playgroud)



这是原始代码(从这里找到:http://developer.android.com/guide/components/processes-and-threads.html):

public void onClick(View v) {
    new DownloadImageTask().execute("http://example.com/image.png");
}

private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
    /** The system calls this to perform work in a worker thread and
      * delivers it the parameters given to AsyncTask.execute() */
    protected Bitmap doInBackground(String... urls) {
        return loadImageFromNetwork(urls[0]);
    }

    /** The system calls this to perform work in the UI thread and delivers
      * …
Run Code Online (Sandbox Code Playgroud)

java generics android

1
推荐指数
1
解决办法
364
查看次数

需要有关Android蓝牙的教程

我想在android中做一个示例蓝牙程序,请给我一个很好的示例程序

android bluetooth

0
推荐指数
1
解决办法
1107
查看次数