【问题标题】:Android: Intent problemAndroid:意图问题
【发布时间】:2010-11-14 14:48:57
【问题描述】:

调试以下代码我收到“未找到源”通知,这可能意味着未设置某些变量:

btnEdit.setOnClickListener(new View.OnClickListener(){

        @Override
        public void onClick(View v) {
            Intent intent = new Intent(v.getContext(), DlgTitleTags.class);
            intent.putExtra(Client.STORED_TITLE, mTitle);
            intent.putExtra(Client.STORED_TAGS, mTags);
            startActivityForResult(intent, SHOW_SUBACTIVITY_TITLE_TAGS);

        }

    });

此处意图已成功创建,并且所有其他变量也已设置,因此我仍在尝试找出导致问题的原因。

我注意到日志消息:

07-28 13:29:09.642: DEBUG/dalvikvm(56): GC freed 2010 objects / 86744 bytes in 230ms
07-28 13:29:14.861: WARN/WindowManager(56): Key dispatching timed out sending to dev.client.android/dev.client.android.DlgEditFile
07-28 13:29:14.862: WARN/WindowManager(56): Dispatch state: {{KeyEvent{action=1 code=4 repeat=0 meta=0 scancode=158 mFlags=8} to Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false} @ 1248780547618 lw=Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false} lb=android.os.BinderProxy@43449e78 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false}}}
07-28 13:29:14.862: WARN/WindowManager(56): Current state:  {{null to Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false} @ 1248780554868 lw=Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false} lb=android.os.BinderProxy@43449e78 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{43377460 dev.client.android/dev.client.android.DlgEditFile paused=false}}}
07-28 13:29:14.872: WARN/WindowManager(56): Continuing to wait for key to be dispatched
07-28 13:29:15.212: INFO/ActivityManager(56): Starting activity: Intent { comp={dev.client.android/dev.client.android.DlgTitleTags} (has extras) }
07-28 13:29:15.522: WARN/ResourceType(1647): Failure getting entry for 0x7f030005 (t=2 e=5) in package 0: 0xffffffb5

对于解决问题的任何帮助,我将不胜感激。

【问题讨论】:

  • 你能发布一个更大的 LogCat 的 sn-p 吗?一个显示正在抛出的异常...
  • 找到原因了吗?我也有同样的问题。

标签: android android-intent


【解决方案1】:

很可能您的活动 DlgTitleTags 未在清单中定义。

【讨论】:

  • 在Manifest中定义
【解决方案2】:
  1. 打开AndroidManifest.xml
  2. 在底部添加另一个活动
  3. 添加后,点击活动,在名称旁边的右侧
  4. 单击浏览并选择其他类文件(.java 文件)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-28
    • 1970-01-01
    • 2012-06-23
    • 2016-07-31
    相关资源
    最近更新 更多