我的代码是:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/Toolbar_Theme"/>
Run Code Online (Sandbox Code Playgroud)
我想在java代码中更改app:theme.我能找到toolbar.setTheme用于改变工具栏样式的方法吗?
我正在使用改造1.9,我创建了注销方法
@GET("/user/logout")
void logoutUser(Callback<Response> callback);
logoutUser(new RequestCallback<Response>(this) {
@Override
public void success(Response response, Response response2) {
settingsService.setUserLoggedOut();
getMainActivity().finish();
}
});
Run Code Online (Sandbox Code Playgroud)
我升级到改装2.0 beta 4并使用此代码
@GET("user/logout")
Call<Response> logoutUser();
logoutUser().enqueue(new RequestCallback<Response>(this) {
@Override
public void onResponse(Call<Response> call, Response<Response> response) {
settingsService.setUserLoggedOut();
getMainActivity().finish();
}
});
Run Code Online (Sandbox Code Playgroud)
我有这个例外:java.lang.IllegalArgumentException:'retrofit2.Response'不是有效的响应主体类型.你的意思是ResponseBody?
问题是什么?
我创建了User类,但是当我想要获取用户对象数组时,我面对Inconsistent可访问性字段类型比字段错误更难访问这是我的代码:
namespace CRUD.Model
{
class User
{
public int id { get; set; }
}
}
namespace CRUD
{
public partial class PurchasesBill : Form
{
public List<User> userList = new List<User>();
}
}
Run Code Online (Sandbox Code Playgroud)