小编Dam*_*iii的帖子

启动画面应用程序并隐藏操作栏

我试图弄清楚如何隐藏动态栏以进行启动画面活动.我做了一些在我的启动画面上隐藏我的操作栏的东西,但是有一个问题:在我的启动画面出现之前,有一个活动,其中一个动作栏出现了短暂的...我不知道如何隐藏它!

我的启动画面仅在我们第一次触摸应用程序时出现,就像应用程序的介绍一样.

代码:

package com.example.basicmaponline;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;

public class Intro extends Activity{

@Override
protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);


    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
    getActionBar().hide();

    setContentView(R.layout.intro);

    Thread timer = new Thread(){
        public void run(){
            try{
                sleep(3000);
            }catch (InterruptedException e) {
                e.printStackTrace();
            }finally{
                Intent openMenu = new Intent("com.example.basicmaponline.MENU");
                startActivity(openMenu);
            }
        }
    };
    timer.start();
}

@Override
protected void onPause() {
    // TODO Auto-generated method stub
    super.onPause();
    finish();
}

}
Run Code Online (Sandbox Code Playgroud)

清单:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" …
Run Code Online (Sandbox Code Playgroud)

user-interface android splash-screen show-hide android-actionbar

23
推荐指数
2
解决办法
4万
查看次数

为什么可运行的回调会自动销毁活动?

我想知道我们是否有可能postDelayed在android上处理/检测带有延迟(方法)的可运行回调?

例如,handler.postDelayed(new Runnable()...我的应用程序(用于测试目的的应用程序)有一个或几个splashscreen(运行).在这个应用程序中,我还有一个库(我正在应用程序中创建和使用它)以及一些在类上运行的IntentService类.

有时,当应用程序运行那些splashscreenActivities(for Testing purpose)时,我正在创建的库可能会在UI中自动弹出一些活动.但似乎如果这些活动出现在splashscreen活动上并且splashscreen正在被销毁,那些活动(自动弹出)也将被销毁并在logcat中记录"泄露的窗口"消息.

问题是:

  • 不应自动关闭UI中自动显示的那些活动,这是禁止的.它需要用户进行交互以关闭该活动并返回应用程序的正常行为.
  • 此外,该库对应用程序的UI一无所知.

所以我的问题是(相对于我正在创建的库方面而没有UI应用程序流的信息):

  • 有没有办法检测是否在相对于库方面的应用程序中创建了一些postDelayed方法?如果是,我该如何处理这个问题呢?

PS:请注意,通常情况下,我正在使用自动出现的假设活动的对话框.

UPDATE

图

图解说明:

现在我有一个正在执行Splashscreen的案例.

扩展IntentService类的类已收到来自Internet的请求,该请求将启动一个Activity.

同时启动了启动画面postdelayed,其他活动已创建并在UI中显示.当X秒已经过去且另一个Activity未被销毁时,将创建Next Activity并自动销毁另一个Activity.在这样做时,Android会相对于Activity抛出"泄露的窗口"消息.

java android android-activity android-handler android-looper

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

命令行终端执行进程并从此进程输入交互

基本上,我在我的java应用程序上按下按钮时会运行一个进程.并且该过程向OS的终端执行命令.但有时这个命令需要与用户进行交互.我想知道是否可以在需要时从流程到用户进行交互?

我的代码:

File marsSimulator = new File("resources/mars_simulator/Mars4_5.jar");
if(marsSimulator.exists() && temp.exists()){
   String res="";
   try {
     Process p = Runtime.getRuntime().exec(new String[]{"java","-jar",marsSimulator.getAbsolutePath(),tempAssembly.getAbsolutePath()});
     p.waitFor();

     InputStream is = p.getInputStream();

     byte b[] = new byte[is.available()];
     is.read(b, 0, b.length); // probably try b.length-1 or -2 to remove "new-line(s)"

     res = new String(b);

   } catch (Exception ex) {
     ex.printStackTrace();
   }
}
Run Code Online (Sandbox Code Playgroud)

另外,我忘了说应用程序是用SWING制作的,并且进程的输出显示在TextArea上......我应该改变什么吗?

请注意,当与用户进行交互时,进程会阻止.如果没有,则该过程不会阻止!

在这种情况下我需要做什么(我不知道该怎么做)?

  1. 当流程需要交互时.我需要知道这个过程何时需要一些互动.
  2. 我需要以交互方式(逐行)获得流程生成的输出.

PS:对于想要了解流程线的人,我使用的是火星模拟器(http://courses.missouristate.edu/KenVollmar/MARS/),我将jar应用程序发送到一个与mips汇编代码相关联的流程中.


下一段代码正在处理我的项目

希望它能为下一位冒险者提供帮助!

感谢Nicolas Filotto帮助我.

我的班级ObservableStream:

class ObservableStream extends Observable {
  private final Queue<String> lines = new ConcurrentLinkedQueue<>();

  public void …
Run Code Online (Sandbox Code Playgroud)

java process

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

GeofencingRequest上`setInitialTrigger`的目的是什么?

我真的不明白课setInitialTrigger上的功能GeofencingRequest.

我知道我们可以创建一些Geofence不同过渡的对象:

  1. 输入
  2. 出口

这对我来说没问题,也可以接受.

现在,我的问题是相对于班级GeofencingRequest,更确切地说是方法setInitialTrigger.我真的不明白我们应该放在那里的价值...... Android文档(这里)对于该方法的含义并没有多大帮助.

想象一下,我有这段代码:

private GeofencingRequest getGeofencingRequest() {
        GeofencingRequest.Builder builder = new GeofencingRequest.Builder();
        builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);
        builder.addGeofences(mGeofenceList);
        return builder.build();
    }
Run Code Online (Sandbox Code Playgroud)

是什么意思GeofencingRequest.INITIAL_TRIGGER_ENTER

对我来说,这意味着,GeofencingRequest应该触发任何Geofence具有ENTER转换的对象.

但想象一下,我有多个Geofence,具有不同的行为ENTER或EXIT转换.

我应该如何使用GeofencingRequest Builder处理/实现?

android geofencing

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

使用CLNDR.js创建日历

我想用CLNDR.js创建一个日历,但我不知道如何开始...我看到了github页面:https://github.com/kylestetz/CLNDR#dependencies 并在我的电脑上安装了github存储库也.但我的问题是:如何在没有github存储库中显示的示例的情况下创建日历...我的意思是,我不明白页面上的示例代码,我想对"如何创建"有一些建议".有人可以帮我吗?我需要哪些文件,我们如何实现...等等

javascript calendar

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

为什么我会收到“匿名哈希中的奇数元素”警告

我的 perl 代码收到警告,不知道为什么...

警告:

Odd number of elements in anonymous hash at /Users/../Tree.pm line 56.
Run Code Online (Sandbox Code Playgroud)

这给了我这一行:

$dic->{$firstLetter}={$letra};
Run Code Online (Sandbox Code Playgroud)

执行上有问题吗?

我的意思是,它通过了所有测试,但它给了我这些错误......就像 10 次总是在同一条线上!请,一些建议将受到欢迎!:)

sub add_word{
    my ($self,$word) = @_ ;
    my $dic = $self->{'dic'};
    my @array = split(//,$word);
    my $firstLetter = shift @array;
    for my $letra(@array){
            if(!$dic->{$firstLetter}){
                    $dic->{$firstLetter} = {$letra};
                    $dic = $dic->{$firstLetter};
            }
            else{
                    if($dic->{$firstLetter}){
                            $dic = $dic->{$firstLetter};
                    }
            }
            $firstLetter = $letra;
    }
    $dic->{$firstLetter} = {"\$" => "\$"};
}
Run Code Online (Sandbox Code Playgroud)

perl hash

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

错误MSB4044:"AdjustJavacVersionArguments"任务未获得所需参数"JdkVersion"的值

我正在尝试运行一个Android应用程序抛出Visual Studio(7.4 Build 1033),似乎我遇到了这个问题:

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2,2):错误MSB4044:"AdjustJavacVersionArguments"任务未获得所需参数"JdkVersion"的值.(MSB4044)

而且......我不知道如何解决这个问题......

我看到Visual Studio有正确的JDK路径(在UI中提到"Found"),JDK的版本也是1.8.

任何帮助我的提示?

android xamarin

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

绑定 AAR 不包括资源文件夹?

我在通过绑定 AAR 库构建 xamarin 项目时遇到问题。绑定项目有一个 AAR 库,其中包含一些资源(构建操作:)LibraryProjectZip。xamarin 中的 Android 应用程序项目具有该绑定项目的引用。一切都完美构建,直到某个时刻......当我运行应用程序时,当应用程序需要执行该绑定项目的一些代码(在这种情况下,来自 AAR 库的代码)时,它会使应用程序崩溃!出现此错误的原因是该代码段未找到该 AAR 库中可用的布局...

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/myapplication/android/R$layout;
at com.myapplication.android.view.MyView.<init>(NativeInAppView.java:27)
Run Code Online (Sandbox Code Playgroud)

我在这里检查了文档。

 LibraryProjectZip – Embeds an .AAR file into the resulting Bindings Library .DLL. This is similar to EmbeddedJar, except that you can access resources (as well as code) in the bound .AAR file. Use this option when you want to embed an .AAR into your Bindings Library.
Run Code Online (Sandbox Code Playgroud)

所以......这意味着应该包含资源......我的项目有什么问题?

android xamarin.android xamarin aar

5
推荐指数
0
解决办法
469
查看次数

关于实施的完整日历问题

我在实现FullCalendar时遇到了问题...我想,我在http://arshaw.com/fullcalendar/docs/usage/上的"基本用法"主题上做了所有的事情. 为什么那段代码没有?在我的.html上出现我的callendar?

<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>
        Callendar Test
    </title>
    <link rel='stylesheet' type='text/css' href='fullcalendar.css' />

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript" src='fullcalendar.js'></script>
    <script type="text/javascript">
        $(document).ready(function() {

            // page is now ready, initialize the calendar...

            $('#calendar').fullCalendar({
                // put your options and callbacks here


            })

        });  
    </script>
</head>
<body>
    <div id='calendar'></div>


</body>
</html>
Run Code Online (Sandbox Code Playgroud)

有解决方案吗

PS:我下载了Jquery文件(版本1.x)并与我的HTML页面放在同一个文件中.

错误:

Unknown property 'zoom'.  Declaration dropped. fullcalendar.css:107
18:50:38.058 Expected 'none' or URL but found 'alpha('.  Error in parsing value for              'filter'.  Declaration dropped. …
Run Code Online (Sandbox Code Playgroud)

html jquery

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

Creating a custom tree with javafx

Basically, I wanted to know if I could create a tree and custom it on javaFX... I tried to do it, but couldn't do anything so far with this code...

public class Main{
    ......

 public Main() throws Exception{
    ......    

   // TreeView created
    TreeView tv = (TreeView) fxmlLoader.getNamespace().get("treeview");

    TreeItem<String> rootItem = new TreeItem<String>("liss");
    rootItem.setExpanded(true);
    tv.setRoot(rootItem);

    /*for (int i = 1; i < 6; i++) {
        TreeItem<String> item = new TreeItem<String> ("Message" + i);
        rootItem.getChildren().add(item);
    }
    TreeItem<String> item = new TreeItem<String> ("MessageWoot"); …
Run Code Online (Sandbox Code Playgroud)

java treeview javafx

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

无法将bool转换为IO Bool

我正在尝试做一个返回true或false的函数.

owlFile = ".+\\.owl"

testOwlFile src = src =~ owlFile :: Bool

我需要在我的阻止上使用:

main = do
       [src] <- getArgs
       resTestOwlFile <- testOwlFile
       if resTestOwlFile
            then do ontology <- runX(readDocument [withValidate no,withRemoveWS yes ] src >>> getontology)
            else print "error"
Run Code Online (Sandbox Code Playgroud)

但我有一个错误 Couldn't match excepted type IO BOOL with actual type Bool In the return type of a call of "testOwlFile"

我该怎么办?

haskell

0
推荐指数
2
解决办法
978
查看次数

Nice looking table with StringBuilder

I know that "printf" method can use string formatting.

My question is : Is there a way to create a nice looking table with StringBuilder class?

For example:

|Id|Category|Level|Space|Type|Adress|Dimension|Limits|

And under that row, i must add the values of each columns!

Doing something like that : example but with StringBuilder


所以社区希望看到我的答案(我不明白为什么......但无论如何我都会说出来!)

public String toString(){
    StringBuilder s = new StringBuilder();

    s.append("Category: "+this.category+"\t");
    s.append("Level: "+this.level.toString()+"\t");

    return s.toString();
}
Run Code Online (Sandbox Code Playgroud)

现在解释一下,为什么看到我的回答会对我有所帮助?我真的很想看看你的答案!

java stringbuilder

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