我想让listview无法选择且无法点击.我在谈论点击列表项时发生的颜色变化.代码如下.我是android的新手,所以请善待.
来自:listitem.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="8px">
<TextView
android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFF"/>
<TextView
android:id="@+id/data"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16px"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
来自:details.java
TestActionAdapter() {
super(TestDetails.this, R.layout.action_list_item, actions);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TestAction action = actions.get(position);
LayoutInflater inflater = getLayoutInflater();
View view = inflater.inflate(R.layout.action_list_item, parent, false);
TextView label = (TextView) view.findViewById(R.id.label);
label.setText(action.getLabel());
TextView data = (TextView) view.findViewById(R.id.data);
data.setText(action.getData());
return view;
}
Run Code Online (Sandbox Code Playgroud) 考虑这个proguard语句:
-keep public class * extends android.support.design.widget.CoordinatorLayout$Behavior { *; }
Run Code Online (Sandbox Code Playgroud)
在这个声明中添加{*; } 意思?
它保留所有方法吗?所有领域?还是整个班级?
我需要在这样的方法中验证a.
validateFileName(Editable s) {
String filtered_str = s.toString();
if (filtered_str.matches(".*[regexp].*")) {
filtered_str = filtered_str.replaceAll("[regxp]", "");
s.clear();
s.append(filtered_str);}
Run Code Online (Sandbox Code Playgroud)
我应该使用哪个regexp来排除所有非法字符和空格?我正在使用linux
我使用ActionBarSherlock我的应用程序,这是我使用隐藏代码Title的ActionBar:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayUseLogoEnabled(true);
setContentView(R.layout.main_fragment);
}
Run Code Online (Sandbox Code Playgroud)
这个问题是当应用程序启动时,Logo并且Title会同时显示并且会有很短的时间.这看起来很难看,我怎么能摆脱它呢?
我正在尝试使用proguard和混淆我的android应用程序ant(eclipse+ proguard从不工作,总是失败error 1).但我正在class file ... unexpectedly contains class ...警告所有地方,并且构建失败.我也尝试过-ignorewarnings选项proguard.构建成功但我得到一个无法使用的包.
这是蚂蚁输出:
-post-compile:
optimize:
[jar] Building jar: /home/binoy/git/Vibhinna/proguard/unoptimized.jar
[java] ProGuard, version 4.8
[java] Reading input...
[java] Warning: class [classes/com/actionbarsherlock/R$array.class] unexpectedly contains class [com.actionbarsherlock.R$array]
[java] Warning: class [classes/com/actionbarsherlock/R$attr.class] unexpectedly contains class [com.actionbarsherlock.R$attr]
[java] Warning: class [classes/com/actionbarsherlock/R$bool.class] unexpectedly contains class [com.actionbarsherlock.R$bool]
[java] Warning: class [classes/com/actionbarsherlock/R$color.class] unexpectedly contains class [com.actionbarsherlock.R$color]
....
[java] Warning: class [classes/com/actionbarsherlock/R$xml.class] unexpectedly contains class [com.actionbarsherlock.R$xml]
[java] …Run Code Online (Sandbox Code Playgroud) 我正试图禁用SearchView我的Activity.我尝试了以下代码:
mSearchView.setEnabled(false);
mSearchView.setFocusable(false);
mSearchView.setClickable(false);
Run Code Online (Sandbox Code Playgroud)
但它不起作用.仍然可以单击SearchView并弹出KeyBoard.我希望它变得灰暗,不可点燃.我怎么能做到这一点?
我android.support.v4.view.PagerTabStrip在xml中定义如下:
<android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<!--
This title strip will display the currently visible page title, as well as the page
titles for adjacent pages.
-->
<android.support.v4.view.PagerTabStrip android:id="@+id/pager_title_strip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:background="#33b5e5"
android:textColor="#fff"
android:paddingTop="4dp"
android:paddingBottom="4dp" />
</android.support.v4.view.ViewPager>
Run Code Online (Sandbox Code Playgroud)
我怎样才能改变TabIndicater颜色?它可以通过setTabIndicatorColor(int color)以编程方式更改,但我需要在xml中找到一种方法.
android actionbarsherlock android-actionbar android-support-library
如何从所选Listview项目中设置上下文菜单的标题?以下是我的主要活动.
public class OListActivity extends ListActivity {
......
......
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
registerForContextMenu(getListView());
......
......
MatrixCursor cursor;
cursor = NameManager.getnameList();
startManagingCursor(cursor);
String[] from = { "name", "info", "status", BaseColumns._ID };
int[] to = { R.id.name, R.id.info, R.id.status };
SimpleCursorAdapter adapter = new SimpleCursorAdapter(this,
R.layout.row, cursor, from, to);
setListAdapter(adapter);
}
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
menu.setHeaderTitle("Menu");// TODO Change to name of selected listview item. …Run Code Online (Sandbox Code Playgroud) 我正在尝试根据我的ICS AVD,并试过这个:
adb shell mount -o rw,remount -t yaffs2 /dev/block/mtdblock03 /system
adb push su /system/xbin/su
adb shell chmod 06755 /system
adb shell chmod 06755 /system/xbin/su
Run Code Online (Sandbox Code Playgroud)
它失败并出现以下错误:
无法将'su'复制到'/ system/xbin/su':内存不足
我怎样才能解决这个问题?
我正在尝试hello.py从Android进程中运行python脚本.
以下是我遵循的步骤:
但是我仍然收到以下错误:
07-19 13:35:15.391 26991-26991/com.vibhinna.example I/System.out: Here is the standard output of the command:
07-19 13:35:32.001 26991-26991/com.vibhinna.example I/System.out: Here is the standard error of the command (if any):
07-19 13:35:32.001 26991-26991/com.vibhinna.example I/System.out: Fatal Python error: Py_Initialize: Unable to get the locale encoding
07-19 13:35:32.001 26991-26991/com.vibhinna.example I/System.out: ImportError: No module named 'encodings'
07-19 13:35:32.001 26991-26991/com.vibhinna.example I/System.out: Current thread 0xb6f0dec8 (most recent call first):
Run Code Online (Sandbox Code Playgroud)
这是用于执行文件的代码.
String pyPath = getFilesDir().getAbsolutePath() + "/usr/bin/python";
String helloPath = getFilesDir().getAbsolutePath() + …Run Code Online (Sandbox Code Playgroud)