activity

UiPath之如何打印PDF

梦想与她 提交于 2019-12-03 10:55:53
各位小伙伴,大家好,今天写一点基础知识,如何在UiPath中打印PDF. ---小U的QQ群(714733686):小U的订阅号【UiPath8888】--- 当然,我们最希望的就是有一个Activity能够直接给个文件的全路径就可以打印。 好在UiPath还真有这样的Activity。 如果没有的话,也没有关系,我们还可以用Selector来实现打印。 我们先来看看直接用Activity来打印,大家可以在包管理里面搜索printer,就可以找到了。 先看看流程图: 获取指定目录下的PDF文件的绝对路径。 注意:files是一个字符串数组。Directory.GetFiles("E:\","*.pdf") 使用foreach来循环打印每个PDF文件。Input里面写上文件的路径:item.ToString     这个是直接使用PDF来打印 ---------------------------分割线------------------------------ 2.使用Selector来实现打印的功能,下面这个流程是通过单击文件,右键选择打印来实现。 整个流程如下 第一:这里定义的i用来控制我们的seletor中的变量,可以实现逐个选择pdf文件。 下面看看下面的click Activity 下面是selector的设定 第二,选择鼠标右键出来的菜单,里面选择打印, 注意:在这里

fragment的作业

我只是一个虾纸丫 提交于 2019-12-03 10:25:37
Fragment是一种嵌入在Activity中的UI片段,它可以用来描述Activity中的一部分布局。 如果Activity界面布局中的空间比较多比较复杂,用Activity管理起来比较麻烦,可以用Fragment把屏幕划分几个片段,进行模块化管理,可以使程序更加合理和充分地利用屏幕的空间。 Fragment生命周期: 1. 当一个fragment被创建的时候,它会经历以下状态. onAttach() onCreate() onCreateView() onActivityCreated() 2. 当这个fragment对用户可见的时候,它会经历以下状态。 onStart() onResume() 3. 当这个fragment进入“后台模式”的时候,它会经历以下状态。 onPause() onStop() 4. 当这个fragment被销毁了(或者持有它的activity被销毁了),它会经历以下状态。 onPause() onStop() onDestroyView() onDestroy() // 本来漏掉类这个回调,感谢xiangxue336提出。 onDetach() 5. 就像activitie一样,在以下的状态中,可以使用Bundle对象保存一个fragment的对象。 onCreate() onCreateView() onActivityCreated() 6.

C++贪心算法实现活动安排问题

微笑、不失礼 提交于 2019-12-03 10:25:27
_(:з」∠)_ 1 #include <cstdio> 2 #include <iostream> 3 #include <ctime> 4 #include <windows.h> 5 #include <algorithm> 6 #include <fstream> 7 using namespace std; 8 struct activity 9 { 10 int no; 11 int start; 12 int finish; 13 }; 14 bool cmp(const activity &x, const activity &y) 15 { 16 return x.finish<y.finish;//从小到大排<,若要从大到小排则> 17 } 18 int greedySelector(int m,int solution[],struct activity activity[]){ 19 int number = 1; 20 solution[0] = 1; 21 int i,j = 0,counter = 1; 22 for(i = 1;i < m ;i++) 23 { 24 if(activity[i].start >=activity[j].finish) 25 { 26 solution[i] = 1; 27 j = i; 28 counter++;

onActivityResult is not been invoked after the child activity calls finish()

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Though there are several questions regarding this topic, I could not find a right answer to this. I have a main activity (This is one activity in a tabview) from where I am calling the login activity. Button chdbtn=(Button)findViewById(R.id.Add); chdbtn.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { Intent myIntent = new Intent(main.this, Login.class); startActivityForResult(myIntent, 1001); } }); protected void onActivityResult(int requestCode, int resultCode, Intent data){ if(requestCode == 1001) { if

Android google maps v2 crashing on startup

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: In my android app supporting 2.2 and higher, I am trying to use the google maps api v2. I have this so far: Does anyone know what the issue is? Thanks. xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen

Android Actionbar Up button versus system Back button

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm using the Actionbar and it's "up" button to return from a detail activity to the main activity, which works fine. Similarly, the user can press the system "back" button to return to the main activity. In my main activity, in onCreate() data is downloaded from the internet to display upon app start. I noticed that when I use the Actionbar "up" button to go from detail to main activity, onCreate() is run, re-downloading the data. But onCreate() is not run when I use the system "back" button, therefore immediately showing the main activity

Public class must be defined in its own file

匿名 (未验证) 提交于 2019-12-03 10:10:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to use two views in one application to come up with the user's planetary weight. After rewriting the java several times, I finally have it working... mostly, but on the public class Planets it tells me "The public type planets must be defined in its own file." I went into the manifest and made an activity for it, but that didn't help anything. Planets is already the name of one of my xml files. How do I make the public type into its own file? activity_main.xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res

Activity lifecycle issues

匿名 (未验证) 提交于 2019-12-03 10:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have 3 activities running ,navigating a1 to a2 then a2 to a3.Now pressing back button from emulator,I want to go to the activity a1 without finishing activity a2.How can i do this..Please guide me..Thanks in advance 回答1: Yes you can override that back button public void onBackPressed () { Intent start = new Intent ( currentclassname . this , which activity u want . class ); startActivity ( start ); finishActivity ( 0 ); } By this you can move on any activity. This is very easy and simple way 回答2: Try this in your A3 activity's

Android app force closes while going on another activity

匿名 (未验证) 提交于 2019-12-03 09:58:14
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am making an android app using android 2.2 and eclipse. There are two workflows of the app: WF1: CoverPageApp -> LoginActivity -> Dashboard. WF2: CoverPageApp -> RegisterActivity -> Dashboard. But as I click on the Start Button in CoverPageApp to go on another activity, i.e LoginActivity, the app force closes. I have also included the LogCat which shows error of Null Exception and in the LoginActivity Java File it points on the line 51: btnLinkToRegistrScrn = (Button) findViewById(R.id.LinkToRegisterScreen); AndroidManifest.xml <?xml

Saving and restoring activity state?

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: So, i have looked at many different ways and posts about saving and restoring an activities state. I know how to do it for preferences, checkboxes, ect... But in this example application i am trying to save the state of a gridview. So in the application, you can add an image then long click it and add it to a cell. Basically a drag and drop. But when the application is eventually terminated and then relaunched, all the cells are empty. How would i save the state of the gridview to restore after the application was "terminated"? I