操作系统版本:Ubuntu 14.04 LTE 64位
Java JRE/JDK版本:Oracle JDK 1.8.0_11
项目目录位于基于NTFS的驱动器上.
每当我尝试清理我的项目时,我都会得到类似下面的内容.
:app:clean FAILED错误:任务执行失败':app:clean'.
无法删除文件:/media/DriveA/AndroidStudioWorkspace/DNA/app/build/intermediates/classes/debug /.../mechandising/MerchandizingActivity$3.class
当我尝试手动删除生成文件夹时,我收到以下错误.
获取文件'/ media/DriveA/AndroidStudioWorkspace/DNA/app/build/intermediates/pre-dexed'的信息时出错:输入/输出错误
我无法弄清楚它是Linux问题还是Studio问题.我在Eclipse(Same Drive)中没有遇到这样的问题所以我只是认为它与我的工作室有问题.
有什么建议??
我一直在尝试将数据推送到android服装模拟器.但一切都是徒劳的.我在仿真器上的监听器没有收到任何呼叫.如果其他人尝试过磨损和推送数据,请帮助.
这是我的接收器代码的样子
private GoogleApiClient mGoogleApiClient;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_qrcode_generation);
mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Wearable.API)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
@Override
public void onLayoutInflated(WatchViewStub stub) {
ivQrImage = (ImageView) stub.findViewById(R.id.ivQRImage);
}
});
}
@Override
public void onDataChanged(DataEventBuffer dataEvents) {
for (DataEvent event : dataEvents) {
if (event.getType() == DataEvent.TYPE_CHANGED &&
event.getDataItem().getUri().getPath().equals("/image")) {
final DataMapItem dataMapItem = DataMapItem.fromDataItem(event.getDataItem());
final Asset profileAsset = dataMapItem.getDataMap().getAsset("profileImage");
final Bitmap bitmap = loadBitmapFromAsset(profileAsset);
Log.d(TAG, ""+bitmap);
if …Run Code Online (Sandbox Code Playgroud) 

我希望SearchView旁边的图标("云")保持可见,即使SearchView扩展.这适用于平板电脑,但在Nexus 5等小型设备的情况下不起作用.
我已经设置了showAsAction="always"这个菜单项.此外,SearchView具有以下属性:showAsAction="ifRoom".
user-interface android android-appcompat android-layout android-actionbar
我试图在单击通知时刷新活动的内容。当我处于其他活动中时,我可以导航到该活动,然后单击通知。我想要实现的是,我正在显示一些内容的活动A中。我收到一个新通知,单击它,应该相对于我在通知的PendingIntent中传递的内容,重新启动活动A或刷新活动中的内容。
我所做的一切
尝试设置PendingIntent.FLAG_CANCEL_CURRENT和PendingIntent.FLAG_UPDATE_CURRENT
Intent.FLAG_ACTIVITY_NEW_TASK |
Intent.FLAG_ACTIVITY_SINGLE_TOP我正在与意图中的意图一起尝试设置。
检查中的数据onNewIntent()不会刷新。我得到的数据与我先前传递的数据相同。
requestCode也与PendingIntent一起传递了唯一性,仍然相同。
还有其他建议吗?
android push-notification android-intent android-activity android-pendingintent
所以我有这个逻辑,每个字符串分割4个字符.像这样的东西
0108011305080508000000 gives 0108 0113 0508 0508 0000 00
Run Code Online (Sandbox Code Playgroud)
我使用的逻辑是
String [] splitErrorCode = inputString.split("(?<=\\G....)");
Run Code Online (Sandbox Code Playgroud)
它在Java中运行良好,但是当我在Android中运行时,我得到了错误的输出.
0108 011305080508000000
我不知道出了什么问题.经过String的split函数后,我意识到Android使用的fastSplit地方,因为Java版本有一个巨大的分裂逻辑.
两个功能都不应该相同吗?为什么这是个问题?有什么意见/建议吗?
已编写自定义错误处理以进行改造.代码完美无缺minifyEnabled false.当我启用proguard时,我得到以下异常
12-17 10:14:07.688 18568-19041/com.mobility.cariq.carscore W/System.err? java.lang.reflect.UndeclaredThrowableException
12-17 10:14:07.688 18568-19041/com.mobility.cariq.carscore W/System.err? at $Proxy9.updatesForModel(Native Method)
12-17 10:14:07.688 18568-19041/com.mobility.cariq.carscore W/System.err? at com.mobility.cariq.carscore.rest.service.UpdateDatabaseService.jiijijliillliliilllil(UpdateDatabaseService.java:119)
12-17 10:14:07.688 18568-19041/com.mobility.cariq.carscore W/System.err? at com.mobility.cariq.carscore.rest.service.UpdateDatabaseService.onHandleIntent(UpdateDatabaseService.java:75)
12-17 10:14:07.689 18568-19041/com.mobility.cariq.carscore W/System.err? at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
12-17 10:14:07.689 18568-19041/com.mobility.cariq.carscore W/System.err? at android.os.Handler.dispatchMessage(Handler.java:102)
12-17 10:14:07.689 18568-19041/com.mobility.cariq.carscore W/System.err? at android.os.Looper.loop(Looper.java:136)
12-17 10:14:07.689 18568-19041/com.mobility.cariq.carscore W/System.err? at android.os.HandlerThread.run(HandlerThread.java:61)
12-17 10:14:07.689 18568-19041/com.mobility.cariq.carscore W/System.err? Caused by: com.mobility.cariq.carscore.rest.error.UnauthorizedException
12-17 10:14:07.690 18568-19041/com.mobility.cariq.carscore W/System.err? at com.mobility.cariq.carscore.rest.error.RestErrorHandler.handleError(RestErrorHandler.java:40)
12-17 10:14:07.690 18568-19041/com.mobility.cariq.carscore W/System.err? at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:242)
Run Code Online (Sandbox Code Playgroud)
错误处理程序
public class RestErrorHandler implements ErrorHandler {
@Override
public …Run Code Online (Sandbox Code Playgroud) 我正在尝试将“折叠的工具栏”的标题居中。但是基本布局本身似乎存在一些错误。标题由于某些原因而有偏移。无法找出解决方法。同样,似乎也没有属性将负的边距/填充应用于collapsedTitle。
<android.support.design.widget.CoordinatorLayout
android:id="@+id/coordinator_layout"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/app_bar_height"
android:fitsSystemWindows="true"
android:theme="@style/XXXXAppTheme.AppBarOverlay">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsingToolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:collapsedTitleGravity="center"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleGravity="top|center_horizontal"
app:expandedTitleMarginTop="-10dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="REGISTER">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin"
app:popupTheme="@style/XXXXAppTheme.PopupOverlay"/>
<ImageView
android:id="@+id/ivContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/white_background"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
app:layout_collapseMode="parallax"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<FrameLayout
android:id="@+id/flContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
android ×7
java ×3
android-collapsingtoolbarlayout ×1
linux ×1
obfuscation ×1
proguard ×1
regex ×1
retrofit ×1
string ×1
ubuntu-14.04 ×1
wear-os ×1