我在使用Android Studio(0.1.5)编译我的应用时遇到问题.该应用程序使用2个库,我包括如下:
settings.gradle
include ':myapp',':library',':android-ColorPickerPreference'
Run Code Online (Sandbox Code Playgroud)
的build.gradle
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.4'
}
}
apply plugin: 'android'
dependencies {
compile files('libs/android-support-v4.jar')
compile project(':library')
compile project(':android-ColorPickerPreference')
}
android {
compileSdkVersion 17
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 16
}
}
Run Code Online (Sandbox Code Playgroud)
编译时我收到此消息:
Gradle: A problem occurred configuring project ':myapp'.
> Failed to notify project evaluation listener.
> Configuration with name 'default' not found.
Run Code Online (Sandbox Code Playgroud)
你能帮我这个消息吗?谢谢!
我需要在我的Android应用中将数据从一个表移动到另一个表
我想使用以下sql:
insert into MYTABLE2 select id, STATUS risposta, DATETIME('now') data_ins from MYTABLE 2
Run Code Online (Sandbox Code Playgroud)
不幸的是,在表MYTABLE2中有一个_ID列AUTOINCREMENT.我能做什么?
谢谢.
编辑: 这是我的MYTABLE2,我希望用另一个表中的数据填充表格:
CREATE TABLE "ANSWERS" ("_id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
"ID_QUESTION" INTEGER,"DATE_INS" DATETIME DEFAULT
(CURRENT_DATE) , "ANSWER" INTEGER)
Run Code Online (Sandbox Code Playgroud) 我想在我的应用程序中有两个主要活动.所以在我的清单中我说:
<activity
android:name="mypackage1.MainActivity"
android:label="@string/title_activity_main">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="mypackage2.MainActivity2"
android:label="@string/title_activity_main2">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)
我的应用程序菜单中创建了两个图标.但是当我点击它们时,第一个活动MainActivity总是会启动.是否可以进行两项主要活动?如果是这样,我做了什么错了?谢谢
您好我有这个错误
Uploading file
local path: C:\Users\myuser\AndroidStudioProjects\Myapp\build\classes\debug\Myapp.apk
remote path: /data/local/tmp/mypackage
Local path doesn't exist.
Run Code Online (Sandbox Code Playgroud)
上传到我的设备时.我看到Myapp.apk在apk文件夹中创建它应该是.但Android Studio尝试从类\ debug \上传
你知道如何解决这个问题吗?谢谢
如何在打开文本字段的情况下使用SearchView启动活动.通过这种方式,我可以搜索而无需点击望远镜.我正在使用Sherlock Action Bar.
这是我的代码:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
final SearchView searchView = new SearchView(getSupportActionBar().getThemedContext());
searchView.setQueryHint("Cerca domande");
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
@Override
public boolean onQueryTextSubmit(String query) {
if (query.length() != 0) {
// handle search here
return true;
}
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
if (newText.length()>=3) {
new PostTask().execute(newText);
Util.setSharedPreferences(SearchActivity.this, "lastsearch", newText);
}
return false;
}
});
menu.add("Search")
.setIcon(ic_search_inverse)
.setActionView(searchView)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW);
listsearch.setOnItemClickListener(this);
return true;
}
Run Code Online (Sandbox Code Playgroud)
谢谢.
我的水平滚动条有问题.我不希望它出现.实际上它只显示在Chrome中,而不是在Internet Explorer中显示.我能做什么?我已经尝试在css类中修改宽度和填充,但这也会改变布局.内部测试内容是动态的,因此它可以垂直溢出,这很好,因为我只是不想要水平滚动条.
HTML:
<div class="test">
<table>
<tr>
<td>test</td>
</tr>
</table>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.test {
BORDER-TOP: #7F9DB9 1px solid;
BORDER-RIGHT: #7F9DB9 1px solid;
BORDER-LEFT: #7F9DB9 1px solid;
BORDER-BOTTOM: #7F9DB9 1px solid;
WIDTH: 100%;
PADDING-RIGHT: 0px;
PADDING-LEFT: 10px;
PADDING-BOTTOM: 10px;
PADDING-TOP: 10px;
HEIGHT: 100%;
BACKGROUND-COLOR: #ffffff
}
Run Code Online (Sandbox Code Playgroud)
如果你需要它,这里是一个小提琴:http://jsfiddle.net/XLY9L/
谢谢
我无法将数字显示为货币.
我使用的代码是:
<h:outputText id="id_importo" value="33333,33">
<f:convertNumber type="currency" currencySymbol="€" locale="it_IT"/>
</h:outputText>
Run Code Online (Sandbox Code Playgroud)
产生此错误:
javax.faces.convert.ConverterException: id_importo: '33333,33' could not be understood as a currency value.
at javax.faces.convert.NumberConverter.getAsObject(NumberConverter.java:621)
at
....
Caused by: java.text.ParseException: Unparseable number: "33333,33"
at java.text.NumberFormat.parse(NumberFormat.java:344)
at javax.faces.convert.NumberConverter.getAsObject(NumberConverter.java:614)
... 63 more
Run Code Online (Sandbox Code Playgroud)
我甚至<h:outputText id="id_importo" value="33333,33">没有运气.
我正在尝试ActionBarSherlock SearchView.不幸的是
public boolean onKey(View arg0, int arg1, KeyEvent event)
Run Code Online (Sandbox Code Playgroud)
没有解雇.你知道原因吗?我在帖子中看到 SearchView imeOptions和onQueryTextSubmit支持 用户以另一种方式解决了问题.也许我应该这样做?
谢谢
这是我的代码:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
//Used to put dark icons on light action bar
boolean isLight = SampleList.THEME == R.style.Theme_Sherlock_Light;
//Create the search view
final SearchView searchView = new SearchView(getSupportActionBar().getThemedContext());
searchView.setQueryHint("Search for countries…");
System.out.println("searchView.getQuery()"+searchView.getQuery());
searchView.setOnKeyListener(new OnKeyListener()
{
/**
* This listens for the user to press the enter button on
* the keyboard and then hides the virtual keyboard
*/
@Override
public boolean …Run Code Online (Sandbox Code Playgroud) android ×6
searchview ×2
css ×1
currency ×1
gradle ×1
html ×1
jsf ×1
scrollbars ×1
sql ×1
sqlite ×1