我在eclipse中为android创建了一个小应用程序,当我按下"Run"时,会创建一个新的AVD,eclipse告诉我该应用程序已安装在AVD上,但我无法在虚拟设备上找到它.为什么会这样?谢谢
我正在为我的Android类做一个项目.该应用程序非常难看,并不是很有用,但它是为了证明我们可以实现内容提供商.我遇到的问题是对Cursor进行排序.这是我的代码:
setContentView(R.layout.main);
String[] projection = new String[] {Phone.CONTACT_ID, Phone.DISPLAY_NAME, Phone.NUMBER};
Cursor mCursor = this.getContentResolver().query(Phone.CONTENT_URI, projection , null, null, "Phone.CONTACT_ID ASC");
startManagingCursor(mCursor);
ListAdapter adapter = new SimpleCursorAdapter(
this, // Context.
R.layout.rows,
mCursor,
new String[] {Phone.CONTACT_ID, Phone.DISPLAY_NAME, Phone.NUMBER},
new int[] {R.id.text1, R.id.text2, R.id.text3});
setListAdapter(adapter);
Run Code Online (Sandbox Code Playgroud) 我刚开始玩mvc,roo和hibernate.
我正在尝试创建两个具有1:M关系的表.
例如,我想要两个实体,Person和Car.一个人可以拥有很多车.
我用Roo创建了实体
entity --class ~.domain.Person
field string Name
entity --class ~.domain.Car
field string Name
field reference --fieldName owner --type ~.domain.Person
field set --fieldName ownedCars --type ~.domain.Car --class ~.domain.Person --cardinality ONE_TO_MANY
Run Code Online (Sandbox Code Playgroud)
生成的汽车类:
@RooJavaBean
@RooToString
@RooEntity
public class Car {
private String Name;
@ManyToOne
private Person owner;
}
Run Code Online (Sandbox Code Playgroud)
生成的Person类
@RooJavaBean
@RooToString
@RooEntity
public class Person {
private String Name;
@OneToMany(cascade = CascadeType.ALL)
private Set<Car> ownedCars = new HashSet<Car>();
}
Run Code Online (Sandbox Code Playgroud)
但是,在数据库中,有3个表(两个中有两个)
表CAR(如预期)
CREATE TABLE "TEST"."CAR"
(
"ID" NUMBER(19,0),
"NAME" VARCHAR2(255 BYTE), …Run Code Online (Sandbox Code Playgroud) 观察StackOverflowError时如何检索完整的调用堆栈?
考虑这个简单的例子:
public class Overflow {
public Overflow() {
new Overflow();
}
public static void a() {
new Overflow();
}
public static void main(String[] argv) {
a();
}
}
Run Code Online (Sandbox Code Playgroud)
现在报告的错误是:
Exception in thread "main" java.lang.StackOverflowError
at Overflow.<init>(Overflow.java:11)
[last line repeated many times]
Run Code Online (Sandbox Code Playgroud)
但我无法在堆栈跟踪中看到main和a方法.我的猜测是因为溢出,堆栈中的最新条目取代了最旧的条目(?).
现在,如何在输出中获取a和main堆栈条目?
其背景是,我得到了一个的StackOverflowError(但是这不是一个无限递归,因为增加堆栈大小时,它不会发生),它是很难发现代码中的问题.我只获取了多行java.util.regex.Pattern代码而不是代码所谓的信息.应用程序太复杂,无法在每次调用Patterns时设置断点.
我创建了一个对象的字典(信用卡):
class CreditCard:
def __init__(self,number,expire_date_month,expire_date_year,CVC):
self.number=number
self.expire_date_month=expire_date_month
self.expire_date_year=expire_date_year
self.CVC=CVC
credit_cards={CreditCard('1000000000000000','3','2011','111'):'VISA'}
credit_cards_frozen=frozenset({CreditCard('1000000000000000','3','2011','111'):'VISA'})
Run Code Online (Sandbox Code Playgroud)
但执行这些命令时出错:
print credit_cards['VISA'] #KeyError: 'VISA'
print credit_cards_frozen['VISA'] #TypeError: 'frozenset' object is not subscriptable
Run Code Online (Sandbox Code Playgroud)
我的代码出了什么问题?
我想,以取代其他其他通过代码视图
例如,我需要改变imageview,以progressBar通过代码.
public void changeToProgressBar(ImageView imageview,Context context){
ProgressBar one = new ProgressBar(context);
one.setLayoutParams(imageview.getLayoutParams());
imageview.setVisibility(View.GONE);
one.setVisibility(View.VISIBLE);
//NOW I NEED TO PLACE 'one' EXACTLY THE PLACE WHERE 'imageview' WAS THERE
}
Run Code Online (Sandbox Code Playgroud)
我需要使用这么多地方.我知道通过发送父母来设置viewgroup.
无论如何viewgroup要从父母那里得到imageview
感谢
如果我做了两个逻辑更改,这在代码中是连续的.Git在交互式添加时将其显示为一个单一的块.
期间有没有办法专门在一个大块中添加几行add --patch?
在使用WCF双工(聊天服务|短信服务)开发迷你项目后,我得到了一个可能不正确的点!!
我认为双相理论是好的和有用的,但使用Wcf Duplex存在很多问题.(如可靠会话,超时例外,客户端地址 - 服务器端管理,客户端代理管理)
我觉得错吗?我想念一下吗?
有关更多信息我使用wsDualHttpBinding而不是tcpBinding.