小编Faw*_*nov的帖子

如何检查哪个Intent启动了活动?

我有很多活动.他们中的每一个都有一个意图,它指的是同一个活动.有没有办法找出哪个意图开始活动?

android

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

致命错误类名必须是有效对象或字符串

我是 laravel 和 php 的新手,我的控制器中有这个函数,它给我错误 致命错误类名必须是有效的对象或字符串

public function getIndex () {
    $categories = array();

    foreach ( $Category::all() as $key=> $category) {
        $categories[$category->id] = $category->name ;
    }
Run Code Online (Sandbox Code Playgroud)

这是我的整个控制器

<?php 

class ProductsController extends BaseController {



public function __construct(){

    $this->beforeFilter('csrf' , array('on'=>'post')) ;
 }

public function getIndex () {
    $categories = array();

    foreach ( $Category::all() as $key=> $category) {
        $categories[$category->id] = $category->name ;
    }


    return View::make('products.index')
    ->with('products' , Product::all())
    ->with('categories' , $categories);
 }

public function postCreate(){

    $validator = Validator::make(Input::all() , Product::$rules);

    if ($validator->passes()){ …
Run Code Online (Sandbox Code Playgroud)

php laravel laravel-4

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

显示和隐藏ImageView

我有一个基于本教程的项目,其中用户旋转一个轮子,一个数字的值int days根据轮子的当前位置而改变,现在我想ImageView circle根据这个数字的值显示或隐藏另一个图像,但是它抛出NullPointerException

这是我的onTouch事,抱歉我的英语不好

@Override
public boolean onTouch(View v, MotionEvent event) {

    switch (event.getAction()) {

        case MotionEvent.ACTION_DOWN:
            // reset the touched quadrants
            for (int i = 0; i < quadrantTouched.length; i++) {
                quadrantTouched[i] = false;
            }
            allowRotating = false;
            startAngle = getAngle(event.getX(), event.getY());
            break;

        case MotionEvent.ACTION_MOVE:
            double currentAngle = getAngle(event.getX(), event.getY());
            rotateDialer((float) (startAngle - currentAngle));
            startAngle = currentAngle;
            days = ((int) currentAngle / 12) + 1;
            String test = Integer.toString(days);
            tvnumber.setText(test); …
Run Code Online (Sandbox Code Playgroud)

android imageview ontouch

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

标签 统计

android ×2

imageview ×1

laravel ×1

laravel-4 ×1

ontouch ×1

php ×1