tag 标签: intent

相关博文
  • 热度 5
    2021-3-17 17:57
    131296 次阅读|
    0 个评论
    Android studio中带回调方法的Intent使用实例
    使用带回调方法的 Intent 进行 Activity 跳转实例 我们通过一个包含两个 Activity 的 Android 工程来实现应用程序内部之间的 Activity 的跳转。 1, 先建立一个空的工程项目 2、 除了系统生成的 MainActivity, 我们再手动新建一个 SecondaryActivity, 建立的方法是到需要的包下右击,然后单击 new Activity ,然后选择需要的 Activity 类型即可。 3、检查 AndroidManifest.xml 中有没有注册新建的 Activity ,没有的注册的话手动添加,代码如下(红色框选的部分): 4、 在 MainActivity 中实现向 SecondaryActivity 发送带请求码的意图,具体实现方法如下: 在 activity_main.xml 中添加一个按钮: 5、 在 SecondaryActivity 中接收 MainActivity 的意图,并向意图中填充要返给 MainActivity 的内容,最后还需要设置一个返回码,在这里加入一个 Button 按钮,并实现点击时结束 SecondaryActivity,SecondaryActivity 中的代码如下: activity_second. xml 中添加一个按钮结束 SecondaryActivity : 6、 结束 SecondaryActivity 时将返回到 MainActivity 界面。此时, MainActivity 中的 onActivityResult() 方法将被回调。在本示例中,该方法的具体实现如下: 运行程序效果如下图所示: 程序运行显示效果 第二个 Activity 显示界面 点击结束第二个 Activity ,程序会返回到主界面 然后查看 Log 有如下记录: 7, 在 Android 开发中,有时多个 Activity 之间需要进行对象的传递,使用 Intent 也可以完成这一功能。具体就是将上面的案例做如下修改: 先创建一个 User 类: 8、再改造MainActivity中的GoSecondaryActivity方法: 最后改造 SecondaryActivity 中接收参数的内容为: 通过上面的改造,一个在多个 Activity 之间传递对象参数的应用就完成了。运行应用,点击按钮即可进入第二个 Activity ,并在日志中出现如下记录: 想要获取android studio软件及手机模拟器以及更多工程源码请关注公众号大鸟科创空间,回复android studio进行下载。
  • 热度 18
    2013-10-8 21:20
    1645 次阅读|
    0 个评论
    In Part 1 of this series, Prakash Narain told me about his early career and the primary steps that prepared him to start up his own company. Then in Part 2 we talked about the early days of Real Intent and the impact that the dotcom boom and bust had on developing technology. Part 3 examined the change in company focus from technology to products and the ways in which changing designs are creating new opportunities for static verification. EE Times: At the end of the last segment, we talked about the specific changes that had affected the company direction. Can you expand on them a little? Prakash Narain: We have learned to listen to customers very carefully, and we attempt to understand where they are coming from and what they are seeking, and look at ways to solve their problems. Understanding the problem is very important to see if we can deliver a solution for that. So, we are no longer being the evangelist that was going to change the EDA landscape, but now intend to march in tandem with our customers to ensure they attain the maximum value from the tools. We no longer have a vision-dominated approach, but instead an agile approach to EDA development. EE Times: Does that mean that you are no longer looking for new opportunities that are not driven by your customers? Narain: While we listen to customers, the key is to not take their words literally. You have to go to the next level of understanding, and that sparks the imagination. From that point onwards is a creative process of crafting a solution. The timescales are very different. When you create a product in this way, the timescales are much shorter and much more agile. EE Times: So what are the new challenges that designers are facing today? Narain: I really believe that SoC signoff is going to become a larger and larger problem. The increasing complexity of design and integration is leading to new failure modes. Innovations in the front-end will be more methodology driven compared to backend needs, which are more technology driven. Solutions will be evolving, and tools that we bring to address those needs will be very important. EE Times: The Internet of Things is being touted as the next new platform that is about hit the industry. What impact do you think this will have on EDA? Narain: The innovations in devices that allow you to access data will enable a change if and only if the location of the data changes—that is, a migration to the cloud. EDA is affected by the number of engineers, and licences are dependent on tool usage and the complexity of the problem. Unless there is a new kind of licensing model, many of which have been tried in the past, the industry will stay in the 2 per cent range of the semiconductor industry. The Internet of Things will create opportunities that many devices companies will be running after, and while that is happening there will be a multitude of platforms being created, and that will create an EDA opportunity. EE Times: Chips these days contain a lot of IP. Tools are needed for IP developers and different tools are needed for integration. Has this changed your strategy at all? Narain: Yes and no. The IP industry is an extension of the changes happening in the semiconductor industry. What used to be a chip has become an IP core, and then we have larger levels of integration. The issues faced by the IP developers are not the leading edge. The biggest challenges are in the companies delivering product, and that will be the focus of our innovation. * * * I hope you have enjoyed this chat with Prakash and that it has enabled you to get a glimpse of the man behind Real Intent. Do you see IP developers having the same or a different set of requirements when it comes to tools? How different are the expectations for price points?   Brian Bailey EE Times
  • 热度 21
    2010-11-2 18:51
    3411 次阅读|
    0 个评论
    A verification engineer often starts with the datasheet or specification of a device (in a language like English) and creates a set of test cases using a verification strategy to verify that the device conforms to the spec. The verification strategy is a set of guidelines that ensure that the test cases cover all of the test space to the required degree of completion. Depending on the abstraction level at which a system is modeled, a system model captures the intended functionality and behavior of a system as well as a lot of "noise" or the implementation details. The right abstraction level for a system model would minimize the amount of noise, that is the model would capture the functionality of the system without capturing how the functionality is realized. A good system model that formally captures intent can be used with automated verification tools to explore and generate test cases automatically with the help of a verification strategy. The verification engineer can then focus on creating and formally describing a better verification strategy, instead of spending much time on enumerating all test cases. To summarize, a good model that captures the intent of the designer can be used to automate test generation and therefore allow verification engineers to focus on what they do best - creating innovative verification strategies that maximize test coverage.