小编fir*_*rap的帖子

无法启动服务意图:未找到

我有同样的问题在这里描述,但我无法理解什么是错的.

我的问题是:无法启动服务Intent {act = .connections.MoodyService} U = 0:找不到

编辑 我已经在源代码中将我的包从连接更改为服务,抱歉让人感到困惑

我的清单 `

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.moody"
android:installLocation="auto"
android:versionCode="0"
android:versionName="0.6.7 alpha" >

<uses-sdk
    android:maxSdkVersion="18"
    android:minSdkVersion="14"
    android:targetSdkVersion="17" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
    android:allowBackup="true"
    android:allowClearUserData="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="activities.MainActivity"
        android:label="@string/app_name" >
    </activity>
    <activity
        android:name="activities.Menu_esq"
        android:label="@string/title_activity_menu_esq" >
    </activity>
    <activity
        android:name="activities.BaseActivity"
        android:label="@string/title_activity_base" >
    </activity>
    <activity
        android:name="activities.MainView"
        android:label="@string/title_activity_main_view" >
    </activity>
    <activity
        android:name="activities.LoginActivity"
        android:label="@string/app_name"
        android:noHistory="true"
        android:windowSoftInputMode="adjustResize|stateVisible" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter> …
Run Code Online (Sandbox Code Playgroud)

android android-intent android-service

29
推荐指数
3
解决办法
6万
查看次数

Android Studio文档自动弹出问题

我是新来的Android Studio IDE.我非常习惯Eclipse IDE,现在使用Android Studio似乎很难完成.困扰我的一件事是设置中的文档自动弹出窗口.弹出窗口始终与参数信息重叠.这很重要.

有没有人知道如何解决这个问题,或者是否有可能拥有2个选项.

我已经尝试更改设置中的延迟,但结果相同.

示例图片: 交叠

android android-studio

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

Android谷歌地图v2性能问题

我正在努力解决问题,并试图解决它几周,但没有满足我的需求的解决方案.我的问题是我要在我的地图上添加多个标记(> = 6000)并且在所有想法/建议和调查后我仍然存在性能问题,因为在地图上添加标记即使在主线程上也是如此标记它是在后台线程中构造的.

假设及进展情况:

  • 我已经读过:标记太多了
  • 我正在使用群集
  • 我只添加可见区域的标记来限制标记的数量并抑制不必要的负荷
  • 我已经尝试过使用Handler,现在我正在使用Asynctask,因为我发现它们的速度要快一点(或者它只是安慰剂)
  • 目前我在onProgressUpdate中添加标记(逐个),但我已经尝试发送一个List并在OnPostExecute(结果)中添加标记,但性能最差.

我的代码:

private class MarkerTask extends AsyncTask<Positions, MarkerOptions, Void> {
    Projection projection;

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        projection = mMap.getProjection();
    }

    @Override
    protected Void doInBackground(Positions... params) {
        List<Vessel> positionsList = new ArrayList<Vessel>(params[0].getList());
        LatLngBounds bounds = projection.getVisibleRegion().latLngBounds;

        for (int i = 0; i < positionsList.size(); i++) {
                if (bounds.contains(locationLatLng) && interval.contains(DateTimeUtc)) {
                MarkerOptions markerOptions = new MarkerOptions();
                markerOptions.position(locationLatLng);
                markerOptions.title(name);
                markerOptions.rotation(getHeading());
                markerOptions.snippet(id);
                markerOptions.anchor(Constants.MARKER_ANCHOR_CENTER, Constants.MARKER_ANCHOR_CENTER);

                publishProgress(markerOptions);
                positionsList.remove(i);
                if (isCancelled())
                    break;
            }
        }

        return …
Run Code Online (Sandbox Code Playgroud)

android google-maps google-maps-android-api-2

8
推荐指数
0
解决办法
1263
查看次数

进度栏与图像在中心

嗨,大家好今天我想尝试做我的自定义进度条,为此我创建了一个spinner_inner和一个spinner_outer,但我的内部大小是大的,并重叠外部.

图片

我的活动

   <ProgressBar
        style="@style/Spinner"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:indeterminateDrawable="@drawable/loading" />

    <TextView
        android:id="@+id/login_status_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="16dp"
        android:fontFamily="sans-serif-light"
        android:text="@string/login_progress_signing_in"
        android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我的风格

<style name="Spinner">
    <item name="android:indeterminate">true</item>
    <item name="android:indeterminateDrawable">@drawable/spinner_outer</item>
    <item name="android:indeterminateDuration">2000</item>
    <item name="android:indeterminateOnly">true</item>
</style>
Run Code Online (Sandbox Code Playgroud)

我的xml

<?xml version="1.0" encoding="utf-8"?>
Run Code Online (Sandbox Code Playgroud)

<item android:drawable="@drawable/spinner_inner"/>
<item>
    <rotate
        android:fromDegrees="0"
        android:interpolator="@android:anim/linear_interpolator"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toDegrees="360" >
        <bitmap
            android:antialias="true"
            android:filter="true"
            android:src="@drawable/spinner_outer" />
    </rotate>
</item>
Run Code Online (Sandbox Code Playgroud)

我已经找到了答案,但没有成功

android-progressbar progress-bar android-drawable

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

Android Checkable LinearLayout 状态

我正在尝试实现一个可检查的线性布局,我已经完成了检查的项目,但现在 onclick 和 onLongClick 不起作用,它应该有任何想法如何实现此行为。

  • 如果未选中 && OnLongClick = 检查
  • 如果选中 && onClick = 取消选中
  • 如果选中 && onLongClick = 取消选中
  • 如果未选中 && onClick = super.performClick()

我的可检查 LinearLayout

public class CheckableLinearLayout extends LinearLayout implements Checkable {

/**
 * Interface definition for a callback to be invoked when the checked state
 * of this View is changed.
 */
public static interface OnCheckedChangeListener {

    /**
     * Called when the checked state of a compound button has changed.
     * 
     * @param checkableView
     *            The …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-linearlayout

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

EventBus不在主线程上

我正试图从我的WS获取位置并在我的GoogleMap片段中更新我的标记,所以我正在做的是:

我的HomeActivity包含2个片段(2个GoogleMaps,其中一个有TileOverlay).

在我的GoogleMap片段中,我正在尝试从OnCameraChangeListener获取我的标记位置,以便在用户移动时添加标记.

我正在使用EventBus和Okhttp进行异步请求!

我的GoogleMapFragment:

public class GoogleMapFragment extends FragmentBase {

@Override
public void onResume() {
    mapView.onResume();
    BusHelper.register(this); // Register the EventBus with my helper
    super.onResume();
}

@Override
public void onPause() {
    BusHelper.unregister(this); // Unregister the EventBus with my helper
    super.onPause();
}

public GoogleMap.OnCameraChangeListener getCameraChangeListener() {
    return new GoogleMap.OnCameraChangeListener() {
        @Override
        public void onCameraChange(CameraPosition cameraPosition) {

           //those are corners of visible region
            VisibleRegion visibleRegion = mMap.getProjection().getVisibleRegion();
            LatLng farLeft = visibleRegion.farLeft;
            LatLng farRight = visibleRegion.farRight;
            LatLng nearLeft = visibleRegion.nearLeft;
            LatLng nearRight …
Run Code Online (Sandbox Code Playgroud)

android google-maps android-fragments greenrobot-eventbus

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

textPersonName和textPassword之间的比较

我的活动是一个简单的登录活动,其中(仅限测试)如果用户名&&密码相等则返回true,否则返回false.

但它总是返回虚假.

即使我转换toString();示例:

String a=(txtUserName.getText().toString() == txtPassword.getText().toString()) ? "equal" : "Nequal";
Run Code Online (Sandbox Code Playgroud)

完整代码:

public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_login);
  txtUserName = (EditText) this.findViewById(R.id.txtUname);
  txtPassword = (EditText) this.findViewById(R.id.txtPwd);
  btnLogin = (Button) this.findViewById(R.id.btnLogin);
  btnLogin.setOnClickListener(new OnClickListener() {
    @Override


      public void onClick(View v) {
      Toast.makeText(LoginActivity.this,txtUserName.getText(),Toast.LENGTH_LONG).show();
      Toast.makeText(LoginActivity.this,"Just for separate", Toast.LENGTH_LONG).show();
      Toast.makeText(LoginActivity.this,txtPassword.getText(), Toast.LENGTH_LONG).show();

      String a=(txtUserName.getText() == txtPassword.getText()) ? "equal" : "Nequal";

      Toast.makeText(LoginActivity.this, a, Toast.LENGTH_LONG).show();

    }

  });
}  
Run Code Online (Sandbox Code Playgroud)

java string android operators

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