我已经看到过滤器方法文档,其中显示调用过滤器会取消所有先前未执行的过滤请求,并发布将在稍后执行的新过滤请求.
但我收到的实际回调有些不同.在我的实现中,它没有取消先前的过滤请求,并publishResults()在最近的搜索条件之后调用先前搜索条件的方法.日志如下:
10-03 17:49:41.781: E/TAG(2150): onTextChanged first Criteria
10-03 17:49:41.781: E/TAG(2150): performFiltering first Criteria
10-03 17:49:41.961: E/TAG(2150): onTextChanged second Criteria
10-03 17:49:41.961: E/TAG(2150): performFiltering second Criteria
10-03 17:49:42.195: E/TAG(2150): publishResults second Criteria
10-03 17:49:42.219: E/TAG(2150): publishResults first Criteria
Run Code Online (Sandbox Code Playgroud) 我一直试图连接到Teradata
Class.forName("com.teradata.jdbc.TeraDriver");
String connectionString = "jdbc:teradata://xxx.xxxxxx.com/database=xxxxxx, tmode=ANSI, charset=UTF8";
String user = "Rocket512";
String password = "aui8mn5";
Connection conn = DriverManager.getConnection(connectionString, user, password);
Run Code Online (Sandbox Code Playgroud)
得到以下
Exception in thread "main" com.teradata.jdbc.jdbc_4.util.JDBCException: [Teradata Database]
[TeraJDBC 14.10.00.17] [Error 8017] [SQLState 28000] The UserId, Password or Account is invalid.
at com.teradata.jdbc.jdbc_4.util.ErrorFactory.makeDatabaseSQLException(ErrorFactory.java:300)
at com.teradata.jdbc.jdbc.GenericLogonController.run(GenericLogonController.java:666)
at com.teradata.jdbc.jdbc_4.TDSession.<init>(TDSession.java:216)
Run Code Online (Sandbox Code Playgroud)
我知道主机是正确指定的,因为我没有得到UnknownHost Exception.
另外我已经仔细检查了我的用户名和密码是否正确.
我运行@ beni23建议的查询(谢谢)
select *
from dbc.logonoff
where logdate >= date '2013-10-31'
Run Code Online (Sandbox Code Playgroud)
这是我得到的结果

什么是Bad Password?我使用SQL Assistant使用这个密码,效果很好.为什么我不能用Java连接?
我试图在android上创建一个自定义复合视图(从relativelayout子类),并尝试指定默认样式.我可以做到这一点,但我想知道defStyleAttr参数用于什么,以及如何使用它.
我遇到了这个方法context.obtainStyledAttributes(AttributeSet set,int [] attrs,int defStyleAttr,int defStyleRes).
我明白那个:
AttributeSet set 如果从XML膨胀,我将从视图的构造函数中获取, int[] attrs 将是我可能创建的任何自定义视图字段的关键值, int defStyleRes 将是我可以提供的默认样式,它被定义为样式资源.但是,我无法弄清楚如何使用int defStyleAttr参数.我已经阅读了文档并提供了这样的attr资源:
<declare-styleable name="BMTheme">
<attr name="BMButtonStyle" format="reference" />
</declare-styleable>
Run Code Online (Sandbox Code Playgroud)
然后在我的主题资源文件中我有这个:
<style name="Theme.Custom" parent="@android:style/Theme">
<item name="BMButtonStyle">@style/BMButton</item>
</style>
Run Code Online (Sandbox Code Playgroud)
反过来引用这种风格:
<style name="BMButton">
<item name="text">some string</item>
<item name="android:paddingLeft">10dp</item>
<item name="android:paddingRight">10dp</item>
</style>
Run Code Online (Sandbox Code Playgroud)
在代码中,当我传入0 for defStyleAttr和样式资源id时defStyleRes,我成功获得了我在BMButton样式中定义的默认值:
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.RightArrowButton, 0, R.style.BMButton);
Run Code Online (Sandbox Code Playgroud)
但是当我传入BMButtonStyle的attr资源id(后面又引用BMButton样式)时,为defStyleAttr0 defStyleRes然后我没有得到我在样式中指定的值.
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.RightArrowButton, R.attr.BMButtonStyle, 0);
Run Code Online (Sandbox Code Playgroud)
如果我defStyleAttr以错误的方式使用参数,请告诉我,如果有人知道,为什么只需要a defStyleAttr和defStyleRes参数就需要a 和参数defStyleRes …
我想将应用程序更改为versionNameAndroidManifest 文件中为我正在构建的特定风格定义的任何内容。
因此,如果我只构建我拥有的 4 种已定义风格中的一种,例如:
gradle assembleFlavor1Debug
我期望Flavor1具有与其特定清单定义的版本名称相同的版本名称(因为清单文件的合并),但这并没有发生。
在构建期间,我如何知道正在构建哪种特定风格?
因为如果我知道正在运行什么风格,
我可以versionName从清单中提取相应的内容并将其设置为android.defaultConfig.versionName,
这解决了我的问题。
我正在尝试将Pinterest集成到我的Android应用程序中并使用image固定/共享消息.但我没有办法做任何事情.我下载了Pinterest SDK并在我的项目中添加了jar文件.
以下是我的代码snnipet.
PinIt pinIt = new PinIt();
PinIt.setPartnerId("My ID");
pinIt.setUrl("http://placekitten.com/400/300");
pinIt.setImageUrl(m_cObjSocialTable.getPinterestImagePath());
pinIt.setDescription(pMessage);
pinIt.setListener(new PinItListener() {
@Override
public void onStart() {
super.onStart();
}
@Override
public void onComplete(boolean completed) {
super.onComplete(completed);
if (completed) {
System.out.println("Pinit complete");
}
}
@Override
public void onException(Exception e) {
super.onException(e);
System.out.println("Pinit Exception");
}
});
pinIt.doPinIt(this);
Run Code Online (Sandbox Code Playgroud)
但它没有发布,在onComplete()中我们变得虚假.请帮帮我
谢谢和问候Tiru
我在Android Studio中关注本教程.
在尝试导入项目时,我得到一个对话框说:
" 该项目正在使用不受支持的Gradle版本." 请点支持的摇篮版本在项目的摇篮设置或项目的摇篮包装(如适用). "
如果我通过声明:" 找不到包含id'com.android.application'的插件来选择包装器方法,它也会失败.
这是Parse的gradle看起来像:
apply plugin: 'com.android.application'
repositories {
mavenCentral() }
dependencies {
compile 'com.parse.bolts:bolts-android:1.1.3'
compile fileTree(dir: 'libs', include: 'Parse-*.jar') }
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
Run Code Online (Sandbox Code Playgroud)
我的项目是Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "id.goes.here"
minSdkVersion 19
targetSdkVersion 21
versionCode 1 …Run Code Online (Sandbox Code Playgroud) 我最近更新了我计算机上的支持库存储库,它附带了支持库的 24.0.0-alpha1 版本。
由于这是一个预览版本,我还不想使用该版本并希望坚持使用 23.2.1。但是,lint 现在将我的所有支持库依赖项标记为已过时。
如何告诉 lint 忽略 alpha 和 beta 版本?
我有两个布局xml文件,每个文件都有自己独立的Activity类.每个类都是有效的,因为我可以从清单文件的应用程序部分引用每个活动,然后启动并运行.我的问题是,当我单击第一个布局xml文件上的按钮转到另一个 - 它将切换到第二个布局xml文件,但该布局上的任何操作都不执行任何操作.第二个活动类中的代码不会触发.例如,当我首先列出MenuActivity时,它将显示布局xml文件,并且该布局上的所有调用都有效.当我单击按钮切换到Home时,它将显示home布局xml文件,但HomeActivity中的所有代码都不执行任何操作.我确定这很简单,但我不能把手指放在上面.提前致谢.
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MenuActivity"
android:label="@string/title_activity_menu" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HomeActivity" />
</application>
Run Code Online (Sandbox Code Playgroud) 我编写了一个代码,用于在ListView中动态显示图像,按钮和文本.所以ListView加载按钮.我想通过单击此按钮删除ListView中的所选项目.
适配器类:
public class LazyAdapter extends BaseAdapter {
private Activity activity;
private String[] data;
private static LayoutInflater inflater=null;
public ImageLoaderLogoUnder imageLoader;
public LazyAdapter(Activity a, String[] d) {
activity = a;
data=d;
inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
imageLoader=new ImageLoaderLogoUnder(activity.getApplicationContext());
}
public int getCount() {
return data.length;
}
public Object getItem(int position) {
return position;
}
public long getItemId(int position) {
return position;
}
public View getView(int position, View convertView, ViewGroup parent) {
View vi=convertView;
if(convertView==null)
vi = inflater.inflate(R.layout.inflatelistview, null);
TextView text=(TextView)vi.findViewById(R.id.textView1);
ImageView image=(ImageView)vi.findViewById(R.id.imageView1); …Run Code Online (Sandbox Code Playgroud) 我刚看完Xavier Ducrohet关于gradle的演讲,我即将开始使用各种口味.我想了解它们与图书馆相比有哪些优势?
我知道android库可以拥有它自己的清单/资源,当然也有源代码,口味也是如此.但还有什么呢?我为什么要用它们?
android ×9
gradle ×4
filter ×1
java ×1
lint ×1
pin-it-sdk ×1
pinterest ×1
socialshare ×1
teradata ×1