小编Par*_*ani的帖子

如何获得Android上的wifi连接速率?

我想知道是否有人可以告诉我怎样才能获得我的Android手机上的wifi连接速率?

android

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

在Android中控制WebView中的链接?

我已经在Android 中的WebView中加载了一个url ,当我点击WebView中加载的url中的链接时,WebView中加载的链接难看,删除了我曾经使用的这个问题setIntialScale(50),这使我的初始url变小了

android webview

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

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

Android - ImageView不显示图像.setImageResource()也没有

我使用ImageView控件如图所示:

<LinearLayout 
        android:orientation="horizontal"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        >

     <ImageView 
        android:id="@+id/imgHangMan"
        android:src="@drawable/hang0"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
   />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

上面的代码在xml文件的Graphical Layout预览中显示图像.但在启动应用程序时,我看不到任何图像.此外,使用更改图像

imgHangMan = (ImageView)findViewById(R.id.imgHangMan);
imgHangMan.setImageResource(R.drawable.hang1);
Run Code Online (Sandbox Code Playgroud)

这段代码也不起作用.图像文件采用.gif格式,位于drawable文件夹中.

有什么指针吗?

android imageview

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

在ORMLITE中使用Max?

我需要在ORMLITE中使用max来检索ormlite表中的最新记录 select max(MODIFIED)FROM TABLE;

我想获得一个具有datemodified最大值的记录,其中userid是id; 对于特定用户ID,我想找到具有最大日期值的记录,即查找特定用户的最新条目

android ormlite

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

Android应用程序在手机启动时不断崩溃

我是android studio的新手(我是学生),所以我不是很熟悉,所以请多多包涵,谢谢。我尝试做一个简单的文本视图,在手机上运行该应用程序时遇到了一些问题。该应用程序每次启动时都会崩溃,因此我尝试在互联网上搜索解决方案。

因此,此视频介绍了logcat并出现了以下问题:

Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.widget.TextView.findViewById(int)' on a null object reference
        at com.example.textview.MainActivity.onCreate(MainActivity.java:26)
Run Code Online (Sandbox Code Playgroud)

MainActivity.java

package com.example.textview;

        import androidx.appcompat.app.AppCompatActivity;

        import android.content.Intent;
        import android.os.Bundle;
        import android.view.View;
        import android.widget.ArrayAdapter;
        import android.widget.AutoCompleteTextView;
        import android.widget.Button;
        import android.widget.EditText;
        import android.widget.TextView;

public class MainActivity extends AppCompatActivity {
    Button btnOne,btnTwo;
    TextView txtOne;
    AutoCompleteTextView txtAuto;
    EditText txtName;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        btnOne=findViewById(R.id.btnoneid);
        btnTwo=findViewById(R.id.btntwoID);
        txtOne.findViewById(R.id.txtid);
        txtAuto= findViewById(R.id.txtAutoID);
        txtName= findViewById(R.id.editTextID);

        String[] WORDS = getResources().getStringArray(R.array.WordSuggest);
        ArrayAdapter<String> adapter = new ArrayAdapter<>(this,android.R.layout.simple_expandable_list_item_1,WORDS);
        txtAuto.setAdapter(adapter); …
Run Code Online (Sandbox Code Playgroud)

java android

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

Android MotionEvent - 无法找到左右动作事件

我正在开发一个应用程序,其中有一个imageview ...我想用鼠标触摸向左或向右移动...

因为我找到了"android.view.MotionEvent",但在MotionEvent中,其中很少有事件

  1. ACTION_CANCEL 2. ACTION_DOWN 3. ACTION_UP ......等.

因此,"LEFT"和"RIGHT"动作没有这样的事件....

那么有没有其他方法来实现"左"和"右"的举动?

android

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

如何从应用程序类中删除Auth Token用于android中Twitter应用程序中的注销功能

我想从应用程序类中删除Auth令牌,在我的Twitter应用程序中我该怎么做请帮助我

谢谢

twitter android

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

在Android中对齐文本对齐方式

我目前正在从服务器的xml文件中将文本加载到我的应用程序中.但是,这些文本被分配给TextView.根据我的需要,我的文字没有对齐.即我希望那些文本作为微软词的理由.

<TextView android:id="@+id/nvContent"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_marginBottom="5dip"
      android:layout_marginTop="5dip"
      android:layout_weight="1"
      android:gravity="fill"
     android:text="Inglot Cosmetics now in Kathmandu Inglot, which has been selling its products in over 240 stores all over the world is now here for you in Kathmandu. It has one of the most extensive colour ranges in cosmetics collections. Working with the best makeup artists, Inglot brings you the latest trends in colour, texture and form. Experiment with countless shades and combinations of face powder, blushers, eye shadows and lipsticks."
    android:textColor="#ff000000" …
Run Code Online (Sandbox Code Playgroud)

user-interface android alignment textview

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

Dart/Flutter - Flutter - 为什么ListView无限

不确定,因为我刚开始用Flutter和Dart制作东西.如果有人可以查看代码并可以共享输入:

  • 如何显示具有固定数量项目的列表视图,让我们说在我的示例中我们获取100个项目
  • 如何实现分页,最初说我要获取第一页然后滚动第二页,依此类推.

问题:

在目前的实施中,我发现了两个问题:

  • 能够在底部无休止地滚动
  • 在logcat输出中查找异常:

    03-15 06:14:36.464 3938-3968/com.technotalkative.flutterfriends I/flutter:抛出另一个异常:RangeError(index):无效值:不在0..99范围内,包括:100

我在我的Github存储库上发布了相同的问题:https://github.com/PareshMayani/Flutter-Friends/issues/1

如果你为这个回购做出贡献,我将不胜感激!

在此输入图像描述

dart flutter

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

Windows Phone 7:面临传递参数的问题

现在我正在开发一个Windows手机应用程序,是的,这是我的第一个Windows应用程序.现在我正面临一个问题,不知道我犯了什么愚蠢的错误.是的,我当然已经完成了调试.

现在,我究竟在做什么?

  1. 将数据从第1页传递到第2页,
  2. 在页面上,捕获onNavigateTo()方法内的数据,是的,我正确地收到它.
  3. 基于我得到的参数/数据(即ID),我正在进行Web服务调用.

问题:如果我从2页移到第3页并再次回到第2页,它再次进行网络通话.DownloadStringAsync在下面的代码中再次调用.

即如果第二页有ListBox有5个数据,现在点击特定项目我移动到第3页,如果我从第3页回到第2页,项目加倍,即10项(仅因为它再次打电话)

以下是可能的参考代码:

protected override void OnNavigatedTo(NavigationEventArgs e)
{
       base.OnNavigatedTo(e);

       type = Convert.ToInt32(NavigationContext.QueryString["Type"]);
       if (type != 0)
       {
           if (NetworkInterface.GetIsNetworkAvailable())
           {
              client.DownloadStringAsync(new Uri(Utils.Constant.WebService_URL));
            }
            else
            {
                    MessageBox.Show("Please check internet connection!!");
            }
        }
}
Run Code Online (Sandbox Code Playgroud)

windows-7 windows-phone-7

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