如果我不需要为旧版本的android授予支持并且只能使用API 17,那么是否有另一种方法来实现广告宣传的水平滑动(如在gmail中)而不使用viewpager,fragmentactivities(新的API已经有片段. ..)等摆脱支持库?
我发现横向滑动的所有教程都展示了如何使用支持库和FragmentActivities来完成它.否则,如果我不能使用他们的本机类和方法,新API的优势是什么?
android native-methods fragment android-viewpager android-support-library
我想扩展ListView,但我不明白我做错了什么.这是我的代码,非常简单和基本:
的manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="15" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".TrymylistviewActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
RES /布局/ main.xml中
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<MyListView android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/android:empty"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
TrymylistviewActivity.java
package com.my.test;
import android.app.ListActivity;
import android.os.Bundle;
public class TrymylistviewActivity extends ListActivity {
/** Called when the activity is first created. */
@Override
public void …Run Code Online (Sandbox Code Playgroud) 这就是我所做的,但永远需要:
>>> import shutil,os
>>> for d in os.listdir("."):
... if os.path.isdir(d):
... shutil.rmtree(d)
Run Code Online (Sandbox Code Playgroud)
目录中包含数千个文件的文件.
最快的方法是什么?