小编use*_*779的帖子

android.support.v7.internal.widget.ActionBarOverlayLayout无法实例化

我是第一次安装(Android studio 1.2 + SDK包),我创建了一个带有演示选项卡活动的测试项目.我没有写过一行代码,一切都是由Android Studio生成的

在fragment_main.xml中,会出现以下问题.

在此输入图像描述

java.lang.ClassNotFoundException: android.support.v4.view.ViewPropertyAnimatorListener
    at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:127)
    at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:53)
    at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:84)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2585)
    at java.lang.Class.getConstructor0(Class.java:2885)
    at java.lang.Class.getConstructor(Class.java:1723)
    at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:348)
    at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
    at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:177)
    at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:214)
    at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:142)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
    at com.android.layoutlib.bridge.bars.BridgeActionBar.<init>(BridgeActionBar.java:84)
    at com.android.layoutlib.bridge.bars.AppCompatActionBar.<init>(AppCompatActionBar.java:56)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.createActionBar(RenderSessionImpl.java:1691)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:362)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:321)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:350)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:497)
    at com.android.tools.idea.rendering.RenderTask$2.compute(RenderTask.java:485)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:894)
    at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:485)
    at com.android.tools.idea.rendering.RenderTask.render(RenderTask.java:590)
    at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
    at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
    at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
    at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
    at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238) …
Run Code Online (Sandbox Code Playgroud)

android android-studio

62
推荐指数
3
解决办法
7万
查看次数

插页式广告显示黑色( - >)AFMA_ReceiveMessage未定义(:1)

我按照Android官方指南添加插页式广告.

如果我使用测试模式:

 AdRequest adRequest = new AdRequest.Builder()
                  .addTestDevice("my code here")
                  .build();
 mInterstitialAd.loadAd(adRequest);
Run Code Online (Sandbox Code Playgroud)

工作正常,我可以看到演示插页式添加.

如果我使用发布模式:

AdRequest adRequest = new AdRequest.Builder().build();
mInterstitialAd.loadAd(adRequest);
Run Code Online (Sandbox Code Playgroud)

我只看到黑色插页式添加和登录红色:

JS:未捕获的ReferenceError:未定义AFMA_ReceiveMessage(:1)

+信息:

  • 我使用上次更新的谷歌播放服务库.
  • 我尝试使用2个设备和2个wifi网络.
  • 在同一设备中,我可以看到其他应用插页式广告
  • 该广告是在过去24小时内在adMob中创建的.
  • 我尝试加载添加前端线程但应用程序崩溃
  • 我的adMob帐户没问题,我还有其他广告在投放.

表现:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Run Code Online (Sandbox Code Playgroud)

(......)

  <activity android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
            android:theme="@android:style/Theme.Translucent" />
Run Code Online (Sandbox Code Playgroud)

活动OnCreate:

 mInterstitialAd = new InterstitialAd(this);
    mInterstitialAd.setAdUnitId("here my add id");
    mInterstitialAd.setAdListener(new AdListener() {
        @Override
        public void onAdClosed() {

            requestNewInterstitial();

        }
    });

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

在app自然休息:

 if (mInterstitialAd.isLoaded()) {
           mInterstitialAd.show();
    }
Run Code Online (Sandbox Code Playgroud)

android admob

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

创建新的种子和种子

我正在使用以下代码创建一个新的torret并分享但是有些东西是错误的,因为从来没有种子.

import sys
import time
import libtorrent as lt

#Create torrent
fs = lt.file_storage()
lt.add_files(fs, "./test.txt")
t = lt.create_torrent(fs)
t.add_tracker("udp://tracker.openbittorrent.com:80/announce", 0)
t.set_creator('libtorrent %s' % lt.version)
t.set_comment("Test")
lt.set_piece_hashes(t, ".")
torrent = t.generate()    
f = open("mytorrent.torrent", "wb")
f.write(lt.bencode(torrent))
f.close()

#Seed torrent
ses = lt.session()
ses.listen_on(6881, 6891)
h = ses.add_torrent({'ti': lt.torrent_info('mytorrent.torrent'), 'save_path': '.', 'seed_mode': True}) 
print "Total size: " + str(h.status().total_wanted)
print "Name: " + h.name()   
while True:
    s = h.status()
    state_str = ['queued', 'checking', 'downloading metadata', \
      'downloading', 'finished', 'seeding', 'allocating', 'checking …
Run Code Online (Sandbox Code Playgroud)

python python-2.7 libtorrent

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

如何以“yyyy-MM-dd HH:mm:ss”格式正确获取日期

String date = (String) android.text.format.DateFormat.format("yyyy-MM-dd HH:mm:ss", new java.util.Date());
Run Code Online (Sandbox Code Playgroud)

某些设备工作正常。但在其他设备中,我得到:

2015-12-24 HH:28:24

在如果我更改 (HH) - > (hh) 时不起作用的设备中。但我需要 24 小时模式的小时。

android

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

使用 android 信标库检测 Eddystone-TLM

我配置了android 信标库来检测 Eddystone 数据包

beaconManager = BeaconManager.getInstanceForApplication(context);
    // Detect the main identifier (UID) frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
    setBeaconLayout("s:0-1=feaa,m:2-2=00,p:3-3:-41,i:4-13,i:14-19"));
// Detect the telemetry (TLM) frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
    setBeaconLayout("x,s:0-1=feaa,m:2-2=20,d:3-3,d:4-5,d:6-7,d:8-11,d:12-15"));
// Detect the URL frame:
beaconManager.getBeaconParsers().add(new BeaconParser().
    setBeaconLayout("s:0-1=feaa,m:2-2=10,p:3-3:-41,i:4-21v"));
beaconManager.bind(this);
Run Code Online (Sandbox Code Playgroud)

在 Android 信标库中从未检测到信标。

@Override
public void onBeaconServiceConnect() {      


beaconManager.addMonitorNotifier(this);       

beaconManager.addRangeNotifier(new RangeNotifier() {
    @Override
    public void didRangeBeaconsInRegion(Collection<Beacon> beacons,
            Region region) {


        if (beacons.size() > 0) {
            Extra.log("Beacons detected", "info");
            //Process beacons data...

        }
    }
});

  try {

      beaconManager.startRangingBeaconsInRegion(new Region(
              "myRangingUniqueId", null, null, null));

    } …
Run Code Online (Sandbox Code Playgroud)

android altbeacon eddystone beacon

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

对于类型通知,未定义setLatestEventInfo(...)

我知道不推荐使用"setLatestEventInfo".但我必须使用它与api lv 8设备兼容,因为新的通知调用功能与api 8设备不兼容.

我在一些项目中使用"setLatestEventInfo",我得到了一个弃用的警告,但在这个新的项目中我得到"未定义类型通知"

Notification note = new   Notification(R.drawable.abc_ic_go_search_api_mtrl_alpha,
                "", System.currentTimeMillis());
        Intent intent;


            intent = new Intent(context, MainActivity.class);


        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
                | Intent.FLAG_ACTIVITY_SINGLE_TOP);

        PendingIntent pi = PendingIntent.getActivity(context, 0, intent, 0);
Run Code Online (Sandbox Code Playgroud)

note.setLatestEventInfo(context,"","",pi);

        note.flags |= Notification.FLAG_NO_CLEAR;

        ((Service) context).startForeground(1337, note);
Run Code Online (Sandbox Code Playgroud)

如果我使用Notification.Builder:

调用需要API级别11(当前最小值为8):new android.app.Notification.Builder

android

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