我有一个listview与修改baseadapterr加载图片到列表项.单击该项目时,它会更改活动的主要内容.现在我不时app appc可能是因为如果这个活动.
java.lang.StackOverflowError
at android.widget.TextView.onDraw(TextView.java:4329)
at android.view.View.draw(View.java:6993)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.View.draw(View.java:6996)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.View.draw(View.java:6996)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.View.draw(View.java:6996)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.View.draw(View.java:6996)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.widget.AbsListView.dispatchDraw(AbsListView.java:1499)
at android.widget.ListView.dispatchDraw(ListView.java:3194)
at android.view.View.draw(View.java:6996)
at android.widget.AbsListView.draw(AbsListView.java:2607)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.ViewGroup.drawChild(ViewGroup.java:1730)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.View.draw(View.java:6996)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.View.draw(View.java:6996)
at android.widget.FrameLayout.draw(FrameLayout.java:357)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.ViewGroup.drawChild(ViewGroup.java:1730)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.View.draw(View.java:6996)
at android.widget.FrameLayout.draw(FrameLayout.java:357)
at android.view.ViewGroup.drawChild(ViewGroup.java:1732)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1459)
at android.view.ViewGroup.drawChild(ViewGroup.java:1730)
at …Run Code Online (Sandbox Code Playgroud) 我是cakephp的新手,我在设置本地开发服务器方面遇到了一些问题.我的蛋糕安装位于http:// localhost/dropbox/my_site /.但是,当我尝试访问该URL时,它告诉我没有设置Dropbox控制器.我怎么告诉CakePHP my_site而不是/localhost/?
我已经尝试添加connect(/localhost/dropbox/*)到路线,但似乎它仍然在错误的位置寻找模型.
我尝试在app/webroot中编辑index.php,但所有的例子都显示了如何用linux格式而不是windows编写目录,所以我不知道如何构造'ROOT'
我在Vista机器上有一个存储在文件夹中的MS-Access数据库(是的,我为该文件夹设置了"修改"权限).
从我的.NET应用程序(VB2008),我可以很好地查询数据库,并向表中添加记录.当我重新运行应用程序时,添加的记录就在那里.
但是,如果我启动Access(2000)并打开数据库,我刚刚更改的表似乎没有添加新记录.
是否与Vista和Access 2000有些不兼容?
编辑: 当我在XP机器上的Access 2003中打开相同的数据库时,新记录显示正常.
所以我刚刚为eclipse安装了Android SDK和ADT插件,遇到了问题.
当我转到main.xml中的图形布局时,没有显示布局.相反,我只是得到这个错误
$java.lang.NullPointerException
at sun.awt.FontConfiguration.getInitELC(Unknown Source)
at sun.awt.FontConfiguration.initFontConfig(Unknown Source)
at sun.awt.FontConfiguration.<init>(Unknown Source)
at sun.awt.windows.WFontConfiguration.<init>(Unknown Source)
at sun.awt.Win32GraphicsEnvironment.createFontConfiguration(Unknown Source)
at sun.java2d.SunGraphicsEnvironment$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.java2d.SunGraphicsEnvironment.<init>(Unknown Source)
at sun.awt.Win32GraphicsEnvironment.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
at sun.font.FontDesignMetrics.getDefaultFrc(Unknown Source)
at sun.font.FontDesignMetrics.getMetrics(Unknown Source)
at sun.awt.SunToolkit.getFontMetrics(Unknown Source)
at sun.awt.windows.WToolkit.getFontMetrics(Unknown Source)
at android.graphics.Paint_Delegate.updateFontObject(Paint_Delegate.java:1062)
at android.graphics.Paint_Delegate.reset(Paint_Delegate.java:1039)
at android.graphics.Paint_Delegate.<init>(Paint_Delegate.java:991)
at android.graphics.Paint_Delegate.native_init(Paint_Delegate.java:614)
at android.graphics.Paint.native_init(Paint.java)
at android.graphics.Paint.<init>(Paint.java:194)
at android.graphics.Paint.<init>(Paint.java:184)
at android.view.ViewGroup.<init>(ViewGroup.java:278) …Run Code Online (Sandbox Code Playgroud) 因此,我们认为向我们的聊天应用程序添加某种Toast功能是个好主意,实际上它工作得很好,但是,当表单显示时,它会抢断焦点,这可以使聊天输入框(当你输入它时)闪烁或清除所有文本(因为焦点被偷走了).
我已经回顾了这个网站上的几个主题,关于如何通过覆盖createparms甚至做showwithoutactivating某些或类似的东西来阻止它发生,但它的工作不正常.
这就是我所拥有的(我为所有评论道歉,我们的老板想要记录所有内容):
public partial class ToastForm : DevComponents.DotNetBar.Metro.MetroForm
{
#region Variables
private readonly int _location;
/// <summary>
/// The list of currently open ToastForms.
/// </summary>
private static readonly List<ToastForm> OpenForms = new List<ToastForm>();
/// <summary>
/// Set the window to top most
/// </summary>
private const int WsExTopmost = 0x00000008;
#endregion // Variables
#region Constructors
/// <summary>
/// Creates a new ToastForm object that is displayed for the specified length of time.
/// </summary> …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用ECLIPSE开发适用于Android的应用程序,但我有太多错误.我的意思是,在尝试编写在GOOGLE开发网站上的代码时- 例如, 我收到了很多错误.
例如:
AdapterView类型中的方法setOnItemClickListener(AdapterView.OnItemClickListener)不适用于参数(new OnItemClickListener(){})
这是我收到的代码错误:
gridview.setOnItemClickListener(new OnItemClickListener() {
}
Run Code Online (Sandbox Code Playgroud)
请帮我解决这个问题.\:
非常感谢 !!!
解决了第一个问题
现在我有另一个问题:
是的,谢谢!
现在它向我显示另一个错误:
Toast类型中的方法makeText(Context,CharSequence,int)不适用于参数(RelativeLayout,String,int)
而我的活动代码是:
package grid.View;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;
import android.widget.RelativeLayout;
import android.widget.Toast;
public class GridViewActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
gridview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View v, int …Run Code Online (Sandbox Code Playgroud) 如何使用xcode 4.2和storyboard通过代码更改视图?单击动态表格视图单元格后,我正在尝试更改视图.由于它的动态,我不能只将它与segue联系起来......
我已尝试使用此代码进行更改,如另一篇关于Stack Overflow的文章所示,但它不起作用:
UIViewController *alertView = [self.storyboard instantiateViewControllerWithIdentifier:@"alertView"];
[self.navigationController pushViewController:alertView animated:YES];
Run Code Online (Sandbox Code Playgroud)
这是我的代码片段,希望它有所帮助!
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(indexPath.row==0){
UIViewController *alertView = [self.storyboard instantiateViewControllerWithIdentifier:@"alertView"];
[self.navigationController pushViewController:alertView animated:YES];
NSLog(@"This code is being called...");
}
Run Code Online (Sandbox Code Playgroud) 我正在用C#开发一个Windows应用程序.在我的应用程序中,我使用了一个静态类.
以下是代码:
public static class clsNumber
{
private static object vValue;
public static object Value
{
get
{
return Value;
}
set
{
Value = value;
}
}
public static string HexValue
{
get
{
try
{
return Microsoft.VisualBasic.Conversion.Hex(vValue);
}
catch
{
return Convert.ToString(vValue);
}
}
set
{
Value = Microsoft.VisualBasic.Conversion.Val("&H" + value);
}
}
}
Run Code Online (Sandbox Code Playgroud)
从另一个类中设置上述类的"HexValue"的值.下面是代码行:
iStick = sOutPut.Substring(0, 8);
clsNumber.HexValue = iStick;
Run Code Online (Sandbox Code Playgroud)
在执行上面的代码行时,会出现以下错误:
"An unhandled exception of type 'System.StackOverflowException' occurred in <.....>.dll"
Run Code Online (Sandbox Code Playgroud)
有人可以帮我解决这个问题吗?提前致谢.
我想使用它,但它不起作用,我想在代码后面创建一个平铺动画,或者如果你知道这个 gol 的项目,请写信给我
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
while(true){
Duration duration = new Duration(TimeSpan.FromSeconds(0.15));
// Create two DoubleAnimations and set their properties.
DoubleAnimation myDoubleAnimation1 = new DoubleAnimation();
myDoubleAnimation1.Duration = duration;
myDoubleAnimation1.From = -173
myDoubleAnimation1.To = 173;
Storyboard sb = new Storyboard();
sb.Duration = duration;
sb.Children.Add(myDoubleAnimation1);
Storyboard.SetTarget(myDoubleAnimation1, image);
// Set the attached properties of Canvas.Left and Canvas.Top
// to be the target properties of the two respective DoubleAnimations.
Storyboard.SetTargetProperty(myDoubleAnimation1, new PropertyPath(StackPanel.MarginProperty));
// Begin the animation.
sb.Begin();}
});
Run Code Online (Sandbox Code Playgroud) 我有一个List对象,我想删除重复的项目,但在列表中至少留下一个重复的项目;
我写了这样的东西但是我会优化这段代码以获得更好的性能,有更快的东西吗?
Const chars As String = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
Dim rnd As New Random()
Dim mylist As List(Of String) = Enumerable.Range(1, 100).Select(Function(i) chars(rnd.Next(0, chars.Length)).ToString).ToList
For n As Integer = mylist.Count - 1 To n = 0 Step -1
'remove the item if it's duplicated
'but leave at least one of the duplicated items in the list
If mylist.IndexOf(mylist.Item(n), 0) < n Then
mylist.RemoveAt(n)
End If
Next
Run Code Online (Sandbox Code Playgroud)