小编mrh*_*nds的帖子

如何解决Value不能为null.参数名称:linq中的source?

我不知道为什么会出现这种错误.它有时会发生,我怀疑我关闭应用程序时仍然运行线程的代码.所以当我再次打开它时会发生.

Value cannot be null.
Parameter name: source
StackTree :
   at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
   at Susenas2015.ViewModels.Kuesioner.VMVsen15_KVal.SettingValidationAndRange(List`1 listTextBox, List`1 listCheckBox, TabControl tabControl) in d:\handita\Office\Project\Susenas 2015\Aplikasi Template Survei\Susenas2015\ViewModels\Kuesioner\VMVsen15_KVal.cs:line 430
   at Susenas2015.ViewModels.Kuesioner.VMVsen15_KVal.vSen15_K_Loaded(Object sender, RoutedEventArgs e) in d:\handita\Office\Project\Susenas 2015\Aplikasi Template Survei\Susenas2015\ViewModels\Kuesioner\VMVsen15_KVal.cs:line 846
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   at …
Run Code Online (Sandbox Code Playgroud)

c# linq

32
推荐指数
3
解决办法
17万
查看次数

How to finish Activity when starting other activity in Android?

I have problems to finish the activity before. I want to start another activity and finish the current activity. When I used finish it didn't exit the current activity.

How can I exit the activity before?

android android-activity

30
推荐指数
3
解决办法
9万
查看次数

如何从Genymotion访问Android模拟器中的文件/数据/数据?

我喜欢使用Genymotion模拟器以如此出色的速度来加载Android.它具有非常好的速度但仍然具有一些不稳定性能.

我如何从Eclipse中的文件浏览器访问Genymotion模拟器中的/ data/data /中的文件?我知道在这个设备中也安装了超级用户权限,所以我可以在root条件下使用这个应用程序.但是我如何从文件浏览器访问它?

我知道这样的操作使用adb-shell,然后是基本的终端命令.我已成功使用此方法,但我希望通过eclipse中的文件浏览器访问它,以便我可以轻松地从模拟器中提取.

eclipse android genymotion

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

滚动视图未在滑动抽屉内滚动

我有一个framelayout的布局,其中有2个子视图,Sliding抽屉和listview.在滑动抽屉里面我需要一个滚动视图但是当我运行它时滚动视图无法滚动.以前有人有同样的问题吗?

这是我的布局,当我删除scrollview中的linearlayout时,它可以正常运行.有人可以帮忙吗?

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<ListView
    android:id="@+id/myListView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" >
</ListView>

<SlidingDrawer
    android:id="@+id/slidedrawer"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:allowSingleTap="false"
    android:content="@+id/konten"
    android:handle="@+id/slider_handle" >

    <LinearLayout
        android:id="@+id/slider_handle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/slider_song"
        android:paddingLeft="40dip"
        android:paddingTop="10dip"
        android:scaleType="centerCrop" >

        <TextView
            android:id="@+id/song_title_animation"
            style="@style/CodeFont"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ellipsize="marquee"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:marqueeRepeatLimit="marquee_forever"
            android:scrollHorizontally="true"
            android:singleLine="true"
            android:text="No song played" />
    </LinearLayout>
    <!-- <include -->
    <!-- android:id="@+id/konten" -->
    <!-- layout="@layout/playback" /> -->

    <LinearLayout
        android:id="@+id/konten"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:orientation="vertical" >

        <LinearLayout
            android:id="@+id/album_art"
            android:layout_width="match_parent"
            android:layout_height="250dip"
            android:background="@drawable/albumart"
            android:gravity="bottom"
            android:orientation="vertical" >


            <SeekBar
                android:id="@+id/seekbar_lagu"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:max="20"
                android:progress="0" …
Run Code Online (Sandbox Code Playgroud)

android slidingdrawer

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

Android应用程序中的内存管理

我有Android应用程序在我的应用程序中使用12个选项卡.每个标签大约有10个viewpager.我的内存有问题,因为如果我打开活动标签,应用程序将创建新的活动实例.当所有标签打开时,速度变慢,我得到了(应用程序无响应)(ANR).

当我打开所有标签时,它会不断发生.我还是不知道如何处理内存.我想处理最近打开的选项卡,但我不知道如何在Android中执行此操作.

有人可以帮我解决这个问题吗?

android android-memory

3
推荐指数
1
解决办法
2113
查看次数

泛型方法中的泛型方法

我有这样的功能

public static void serialize<T>(T serializeObject){
    //this is the trouble
    SerializableEntity<T> entity = new SerializableEntity<T>(serializeObject);
}
Run Code Online (Sandbox Code Playgroud)

如何在泛型中使用泛型?怎么做到这一点?

UPDATE

这里编译错误:

错误图片

c# generics

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

如何在datagrid WPF中创建中心列文本?

我的数据网格中有很多列的wpf datagrid ..

<DataGrid.Columns>
           ...

            <mui:DataGridTextColumn x:Name="Column27" Width="50"  Header="Cabe" Binding="{Binding B4R27,UpdateSourceTrigger=PropertyChanged ,Converter={StaticResource CheckConverter}, Mode=TwoWay}" />
            <mui:DataGridTextColumn IsReadOnly="True" x:Name="Column28" Width="50"  Header="Jumlah Bahan Pokok" Binding="{Binding B4RJ,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" >
                <DataGridTextColumn.CellStyle>
                    <Style TargetType="DataGridCell">
                        <Setter Property="Background" Value="#A2D1A2" />
                        <Setter Property="HorizontalAlignment" Value="Stretch" />
                    </Style>
                </DataGridTextColumn.CellStyle>

                <DataGridTextColumn.ElementStyle>
                    <Style TargetType="TextBlock">
                        <Setter Property="TextAlignment" Value="Center" />
                    </Style>
                </DataGridTextColumn.ElementStyle>

            </mui:DataGridTextColumn>
            <mui:DataGridTextColumn x:Name="Column29" Width="150"   Header="Tulis Nama Pengusaha" Binding="{Binding B4R28,UpdateSourceTrigger=PropertyChanged , Mode=TwoWay}" />
            <mui:DataGridTextColumn x:Name="Column30" Width="130"    Header="Tulis Alamat Lengkap" Binding="{Binding B4R29,UpdateSourceTrigger=PropertyChanged , Mode=TwoWay}" />
        </DataGrid.Columns>
Run Code Online (Sandbox Code Playgroud)

我可以使用上面的代码使用此样式在datagrid中创建我的文本

     <DataGridTextColumn.ElementStyle>
                    <Style TargetType="TextBlock">
                        <Setter Property="TextAlignment" Value="Center" /> …
Run Code Online (Sandbox Code Playgroud)

wpf datagrid wpfdatagrid

0
推荐指数
1
解决办法
8272
查看次数

等回报错误.这段代码出了什么问题?

我有java语法.索里我还是不明白为什么会这样.

public class TestString {
  public static void main(String [] args){
    int i=-1;
    String a=((Object)i).toString();
    if(a=="-1"){
        System.out.println("Same");
    }else{
        System.out.println("Not");
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

然后结果是"不"问题为什么-1字符串与对象中的-1 int不同?

java

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