小编glo*_*100的帖子

Raspberry Pi程序延迟

我使用Raspberry Pi在启动时自动显示网页.

问题是:一旦覆盆子启动,Midori就会启动,但我的消息是"无法解析主机名......".

当我在启动后30秒更新网页时,它会正确显示.

我怎么能在X秒后推迟推出Midori?

我用我的网页启动 /etc/xdg/lxsession/LXDE/autostart

autostart delay raspberry-pi midori

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

java.lang.ClassCastException:android.widget.LinearLayout无法强制转换为android.widget.TextView

我使用我的应用程序时出现此错误:

05-01 14:18:41.000: E/AndroidRuntime(26607): FATAL EXCEPTION: main
05-01 14:18:41.000: E/AndroidRuntime(26607): java.lang.ClassCastException: android.widget.LinearLayout cannot be cast to android.widget.TextView
Run Code Online (Sandbox Code Playgroud)

问题的方法:

public void onItemClick(AdapterView<?> adapterView, View view, int postion,
        long index) {

    // Get MAC adress matching the last 17 characters of the TextView
   String info = ((TextView) view).getText().toString();    //  HERE IS THE ISSUE
   String address = info.substring(info.length() - 17);

    Intent intent = new Intent();
    intent.putExtra(EXTRA_DEVICE_ADDRESS, address);

    setResult(Activity.RESULT_OK, intent);


    BluetoothDevice device = (BluetoothDevice) view.getTag();

    showEquipementActivity(device);
}
Run Code Online (Sandbox Code Playgroud)

和XML文件:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" …
Run Code Online (Sandbox Code Playgroud)

android textview android-linearlayout

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