小编Pas*_*sha的帖子

如何滚动屏幕(我的意思是如何移动屏幕)

这里我有10场.我一次只能查看9个字段,我不能滚动这个屏幕...所以如何使这个屏幕可滚动...朋友们只是帮助我..

这是我的编码.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:stretchColumns="1"
android:scrollbars="vertical"
android:isScrollContainer="true"
android:scrollbarAlwaysDrawVerticalTrack="true">
<TableLayout 
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:stretchColumns="1"
android:scrollbars="vertical"
android:isScrollContainer="true"


android:scrollbarAlwaysDrawVerticalTrack="true">
<TableRow>

    <TextView android:id="@+id/lbl_waybilltype"
        android:layout_column="1" android:text="Waybill Type"
        android:layout_width="wrap_content" android:padding="3dip"
        android:layout_height="wrap_content" android:layout_centerHorizontal="true"
        android:layout_centerVertical="true" android:textStyle="bold" />

    <Spinner android:layout_height="wrap_content" android:id="@+id/spinner_waybilltype"
        android:layout_width="fill_parent" android:gravity="left"></Spinner>

</TableRow>

<TableRow>
    <TextView android:text="Agent ID"
    android:layout_column="1" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:textStyle="bold" />

    <EditText android:layout_width="200dip"
    android:layout_height="wrap_content"
    android:text=""
    android:singleLine="true" />
</TableRow>

<TableRow>
    <TextView android:text="Manifest Number"
    android:layout_column="1" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true"
    android:layout_centerVertical="true"
    android:textStyle="bold" />

    <EditText android:layout_width="200dip"
    android:layout_height="wrap_content"
    android:text=""
    android:singleLine="true" />
</TableRow>

<TableRow>
    <TextView android:text="Manifest Date"
    android:layout_column="1" 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerHorizontal="true" …
Run Code Online (Sandbox Code Playgroud)

android

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

android youtube上传使用意图

Intent intent = new Intent();

intent.setAction(Intent.ACTION_SEND);
intent.setType("video/3gpp");
intent.putExtra(Intent.EXTRA_STREAM, videoURI);
startActivity(Intent.createChooser(intent,"Upload video via:"));
Run Code Online (Sandbox Code Playgroud)

我使用上面的代码通过触发意图将3gp视频上传到youtube

但它抛出异常.

我不明白日期例外和媒体上传之间的关系是什么

05-04 13:04:59.315: ERROR/AndroidRuntime(10671): FATAL EXCEPTION: Thread-12
05-04 13:04:59.315: ERROR/AndroidRuntime(10671): java.lang.NullPointerException
05-04 13:04:59.315: ERROR/AndroidRuntime(10671):     at java.util.Calendar.setTime(Calendar.java:1325)
05-04 13:04:59.315: ERROR/AndroidRuntime(10671):     at java.text.SimpleDateFormat.formatImpl(SimpleDateFormat.java:536)
05-04 13:04:59.315: ERROR/AndroidRuntime(10671):     at java.text.SimpleDateFormat.format(SimpleDateFormat.java:818)
05-04 13:04:59.315: ERROR/AndroidRuntime(10671):     at java.text.DateFormat.format(DateFormat.java:376)
05-04 13:04:59.315: ERROR/AndroidRuntime(10671):     at com.google.android.apps.uploader.clients.youtube.YouTubeSettingsActivity.a(SourceFile:183)
05-04 13:04:59.315: ERROR/AndroidRuntime(10671):     at com.google.android.apps.uploader.clients.SettingsActivity.b(SourceFile:43)
05-04 13:04:59.315: ERROR/AndroidRuntime(10671):     at com.google.android.apps.uploader.clients.j.run(SourceFile:348)
05-04 13:04:59.315: ERROR/AndroidRuntime(10671):     at java.lang.Thread.run(Thread.java:1019)
Run Code Online (Sandbox Code Playgroud)

android

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

阅读Mifare经典卡片的UID标签

我正在创建一个NFC应用程序,我的第一个目标是从mifare标签获取标签uid.当我按下标签按钮时,我的活动进入第二个活动,我应该获得tagID.

我收到资源查找错误.我知道我正在做一些重大错误但却找不到.

请你帮忙.

这是我的Meanifest文件

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.chetan.nfc"
  android:versionCode="1"
  android:versionName="1.0">
<uses-sdk android:minSdkVersion="10"></uses-sdk>
<uses-feature android:required="true" android:name="android.hardware.nfc"></uses-feature>
<uses-permission android:name="android.permission.NFC"></uses-permission>


<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true" android:enabled="true">
    <activity android:name=".actOne"
              android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        </activity>
    <activity android:name="taginfo" android:label="@string/app_name" android:launchMode="standard">
        <intent-filter>
        <action android:name="android.nfc.action.TECH_DISCOVERED"/>
        <category android:name="android.intent.category.DEFAULT"/>           
        </intent-filter>
        <meta-data android:resource="@xml/nfc_tech_filter" android:name="@string/nfc_tech_filter"></meta-data>

    </activity>

</application>

</manifest>
Run Code Online (Sandbox Code Playgroud)

这是我的活动之一:

package com.chetan.nfc;

import java.util.Date;

import android.app.Activity;
import android.app.LauncherActivity;
import android.content.Intent;
import android.content.IntentFilter;
import android.nfc.NfcAdapter;
import android.nfc.tech.NdefFormatable;
import android.os.Bundle;
import android.os.Parcelable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import …
Run Code Online (Sandbox Code Playgroud)

android nfc mifare

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

录制视频时音频问题

我能够录制视频,但我没有收到该视频的音频.任何人都可以帮我同时录制视频和音频.我的代码如下:

mr = new MediaRecorder();
mr.setAudioSource(MediaRecorder.AudioSource.MIC);
mr.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
mr.setVideoSource(MediaRecorder.VideoSource.DEFAULT);       
mr.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
mr.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP);
mPreview = new Preview(RecordVideo.this,mr);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Run Code Online (Sandbox Code Playgroud)

当我把audioSource和audioEncoder放到运行时出错时:log cat详细信息是:

05-07 10:17:01.175: ERROR/MediaRecorder(22990): setAudioEncoder called in an invalid state(2)
05-07 10:17:01.175: ERROR/AndroidRuntime(22990):     at android.media.MediaRecorder.setAudioEncoder(Native Method)
Run Code Online (Sandbox Code Playgroud)

当我从代码中删除那些audioSource和audioEncoder时,它对没有音频的视频工作正常.我需要预先提供带视频的音频:

video android android-video-player

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

如何实现多级可扩展列表视图?

我需要实现多级可扩展列表视图,类似ExpandableListView但超过2级.

现在我使用这个数据结构,但如果需要我可以改变它.这不是很重要.

public class NodeList implements Set<NodeList>

public NodeList(String name) {
        mChilds = new ArrayList<NodeList>();
        mNodeName = name;
}

NodeList root = new NodeList("root");
    NodeList lv_1 = new NodeList("level_1");
    NodeList lv_2 = new NodeList("level_2");
    NodeList lv_3 = new NodeList("level_3");
    root.add(lv_1);
    root.add(lv_2);
    root.add(lv_3);

    NodeList lv_21 = new NodeList("level_21");
    NodeList lv_22 = new NodeList("level_22");
    lv_2.add(lv_21);
    lv_2.add(lv_22);

    NodeList lv_211 = new NodeList("level_211");
    lv_21.add(lv_211);

    NodeList lv_2111 = new NodeList("level_2111");
    NodeList lv_2112 = new NodeList("level_2112");
    lv_211.add(lv_2111);
    lv_211.add(lv_2112);

    NodeList lv_31 = new NodeList("level_31");
    NodeList …
Run Code Online (Sandbox Code Playgroud)

android listview expandablelistview

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