小编Len*_*art的帖子

将数据库中的存储数据导入ListView.

package one.two;


import java.util.ArrayList;
import java.util.List;

import android.app.ListActivity;
import android.database.Cursor;
import android.inputmethodservice.Keyboard.Row;
import android.os.Bundle;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

public class List_View extends ListActivity {

    private ListView lv; 
    private TextView toptext; 
    private TextView bottomtext;

    DBAdapter db = new DBAdapter(this);

    public void onCreate(Bundle icicle)
    {
        super.onCreate(icicle);
        setContentView(R.layout.list_main);
        DBAdapter db = new DBAdapter(this);
        getData();

        toptext = (TextView) findViewById(R.id.toptext); 
        bottomtext = (TextView) findViewById(R.id.bottomtext); 


    }

    private void getData() {

        db.open();

        List<String> items = new ArrayList<String>();

         Cursor c = db.getAllEntry();
         c.moveToFirst(); 

         toptext.setText("Date: …
Run Code Online (Sandbox Code Playgroud)

android listview

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

如何将CSS样式应用到iframe内容?

我想在iframe中为内容应用CSS样式,请查看此链接http://jsfiddle.net/pPqGe/

jQuery的:

$(document).ready(function() {
    $('iframe').contents().find('h1').css('color','red');
});
Run Code Online (Sandbox Code Playgroud)

HTML:

<iframe src="mysite" width="100%" height="100%" id="myframe"></iframe>
Run Code Online (Sandbox Code Playgroud)

对于iframe来源,我使用了一个实时网站.

html css iframe

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

在开始新的录制之前,我们如何检查媒体录制器是否已处于活动状态?

我面临的问题是,当另一个记录处于活动状态(例如默认媒体记录器)时,我的应用程序在记录(媒体记录器)期间崩溃。那么有没有什么办法可以处理这个问题而不被抓住 IllegalStateException呢?如果我使用IllegalStateException录音机音频就会损坏。

android

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

NuGet 包仅在 TFS 管理的源中显示为预发行版

我正在使用 TFS 2017 构建 NuGet 包并将其发布到 TFS 管理的内部源。推送到源成功,但是该包仅被列为“预发布”并且不那么稳定,尽管我将该包提升到了发布视图。我需要如何配置 TFS 才能使包显示为稳定?

tfs nuget azure-artifacts

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

Mac的Visual Studio中的构建前/构建后事件

我是Visual Studio的新手,似乎无法找到去查找构建前和构建后事件的位置。我知道如何在Windows上执行此操作,但是我目前在Mac上运行,而且工作方式似乎有所不同。如果有人可以帮助指导我,那就太好了!我专门在寻找构建后事件,但我认为它们在同一地方。

post-build-event visual-studio-mac

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

Cordova Inappbrowser的离子构建错误

我已经将Cordova Inappbrowser插件添加到我的空白Ionic项目中,但是当我尝试构建或模拟项目时,我得到一个讨厌的构建错误:

2014-08-20 01:41:39.181 xcodebuild[95617:3d23]  DVTAssertions: Warning in /SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-5069/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/SpecificationTypes/BuiltInSpecifications/Compilers/XCGccMakefileDependencies.m:76
Details:  Failed to load dependencies output contents from ``/Users/johndoe/Coding/temp/fb-test/platforms/ios/build/fb-test.build/Debug-iphonesimulator/fb-test.build/Objects-normal/i386/CDVInAppBrowser.d''. Error: Error Domain=NSCocoaErrorDomain Code=260 "The file “CDVInAppBrowser.d” couldn’t be opened because there is no such file." UserInfo=0x7f94945e9260 {NSFilePath=/Users/johndoe/Coding/temp/fb-test/platforms/ios/build/fb-test.build/Debug-iphonesimulator/fb-test.build/Objects-normal/i386/CDVInAppBrowser.d, NSUnderlyingError=0x7f9494731fc0 "The operation couldn’t be completed. No such file or directory"}. User info: {
    NSFilePath = "/Users/johndoe/Coding/temp/fb-test/platforms/ios/build/fb-test.build/Debug-iphonesimulator/fb-test.build/Objects-normal/i386/CDVInAppBrowser.d";
    NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\"";
}.
Function: void XCGccMakefileDependenciesParsePathsFromRuleFile(NSString *__strong, void (^__strong)(NSString *__strong))
Thread:   <NSThread: 0x7f94945e92a0>{name = …
Run Code Online (Sandbox Code Playgroud)

cordova inappbrowser ionic-framework

4
推荐指数
2
解决办法
4616
查看次数

最新的Windows 10更新9860后,Visual Studio 2015 CTP中断了吗?

升级到Windows 10 build 9860后,最新的Visual Studio 14预览开始在启动时显示此错误:

"Microsoft.VisualStudio.Editor.Implementation.EditorPackage"包未正确加载.

在此输入图像描述

当您尝试在闪亮的新IDE中执行任何操作时,事情没有变得更好.例如,以下是创建新C#控制台项目时发生的情况:

Object of type 'System.Collections.Generic.List'1[System.Lazy'1+Boxed[Microsoft.VisualSstudio.Text.IExtensionErrorHandler]]' cannot be converted to type 'System.Collections.Generic.List'1[System.Lazy'1[Microsoft.Text.IExtensionErrorHandler]]'.
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

我不会在这里问一个问题,直到我今天看到它发生在多台机器上.一旦我再现它,我认为值得发布在这里......

visual-studio-2015

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

如何在Interfaces中使用Groovy的属性?

假设我已经在Groovy中定义了一个接口(带有属性),如下所示:

public interface GroovyInterface
{       
    int intProperty;       
    boolean boolProperty;
}
Run Code Online (Sandbox Code Playgroud)

然后我实现了接口:

public class GroovyImplementation implements GroovyInterface
{
    // How do I implement the properties here?        
}
Run Code Online (Sandbox Code Playgroud)

我现在如何在具体类中实现属性?@Override因为IntelliJ抱怨我不能覆盖一个字段,所以不起作用.我已经读过这个类似的问题,但它只是说可以在接口中使用属性,但不能如何使用.

groovy properties

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

如何将 UserControl 中的嵌套控件完全暴露给外部?

假设我有一个非常简单的UserControl

<UserControl x:Class="Test.UserControls.MyControl">
    <DockPanel>
        <Label Content="lorem" />
        <Button Name="ButtonFromUserControl" />
    </DockPanel>
</UserControl>
Run Code Online (Sandbox Code Playgroud)

例如,Button如果我在另一个文件中添加 ,我想从外部访问 的所有属性UserControl。我正在想象这样的事情:

 <StackPanel>
     <usercontrols:MyControl Button.Dock="{Binding ButtonDockPosition}"/>
 </StackPanel>
Run Code Online (Sandbox Code Playgroud)

我知道我可以为每个属性创建依赖属性以使它们可访问,但我还不知道哪些属性稍后可能会或可能不会使用,并且不想为每个嵌套控件的属性添加 DP。

我不确定这是否是正确的方法,如果还有其他方法或模式我也会感兴趣。

编辑:

我还尝试将其Button本身设为 DP,但这不允许我访问其属性:

public static readonly DependencyProperty NestedButtonProperty =
    DependencyProperty.RegisterAttached("NestedButton", typeof (Button), typeof (MyControl),
        new FrameworkPropertyMetadata());
     
     
 public Button NestedButton => ButtonFromUserControl;
Run Code Online (Sandbox Code Playgroud)

c# wpf xaml user-controls dependency-properties

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

如何测试是否已收到 MVVM 灯光消息并对其采取行动?

我有一个派生类,它通过属性注入获取一个对象并在该对象的信使上注册:

public class Foo : AbsFoo
{
    private IBar bar;
    public override IBar Bar 
    {
        get {return bar;}
        set
        {
            bar = value
            if(bar != null)
            {
                bar.Messenger.Register<MyMessage>(this, m => SomeMethod());
            }
        }
    }
    public override void SomeMethod()
    {
        //..
    }
}
Run Code Online (Sandbox Code Playgroud)

基本上,我想设置Bar、发送消息并验证它SomeMethod()被调用。

我的测试是这样的:

var fixture = new Fixture();
fixture.Customize(new AutoConfiguredMoqCustomization());
var messenger = new Messenger();

var barFixture = fixture.Create<IBar>();
barFixture.Messenger = messenger

var fooMock = new Mock<Foo> {CallBase = true};
fooMock.SetupAllProperties();
fooMock.Object.Bar = barFixture;
fooMock.VerifySet(s=> …
Run Code Online (Sandbox Code Playgroud)

c# unit-testing moq autofixture mvvm-light

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